From: John Reiser <jreiser@BitWagon.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.2. ELF loader mystery
Date: Sat, 10 Jan 2004 06:59:40 -0800 [thread overview]
Message-ID: <4000135C.4060008@BitWagon.com> (raw)
In-Reply-To: <20040110145329.36ecaa38@argon.inf.tu-dresden.de>
Udo A. Steinberg wrote:
> Linux 2.2 refuses to allocate certain .bss ELF sections in memory if there
> are PT_LOAD sections following them. Is there any convention saying that
> .bss must always be the last section and must not be followed by PT_LOAD
> sections? OTOH both Linux 2.4 and 2.6 have no trouble getting this right
> and load the binary just fine.
Please give the complete kernel version number: 2.2.19, 2.4.23, 2.6.0, etc.
binfmt_elf has had bugs that were introduced/fixed/re-introduced/re-fixed
within the 2.4 series, for example.
Yes, there was an interpretation of ELF that p_filesz < p_memsz implied .bss
only for the last PT_LOAD in the array of Elf32_Phdr. Later this was changed
so that .bss applied only on the PT_LOAD with the highest p_vaddr, regardless
of position in Elf32_Phdr. [In your example this accounts for the missing
.bss from 0x000a6468 to 0x000b8818, because the p_paddr is 0x00001000 but
the other p_vaddr is 0x000ba000 which is greater.] The best interpretation
is that p_filesz < p_memsz implies ".bss" [kernel-supplied, zeroed bytes
and/or pages] separately for _each_ PT_LOAD.
[Note that binfmt_elf ignores Sections. binfmt_elf pays attention only to
PT_LOAD. Aggregating from Elf32_Shdr into ELf32_Phdr is the job of /bin/ld.]
--
John Reiser, jreiser@BitWagon.com
next prev parent reply other threads:[~2004-01-10 15:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-10 13:53 Linux 2.2. ELF loader mystery Udo A. Steinberg
2004-01-10 14:13 ` Udo A. Steinberg
2004-01-10 14:59 ` John Reiser [this message]
2004-01-10 15:19 ` Udo A. Steinberg
2004-01-10 16:24 ` John Reiser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4000135C.4060008@BitWagon.com \
--to=jreiser@bitwagon.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.