From: "H.J. Lu" <hjl.tools@gmail.com>
To: Ian Lance Taylor <iant@google.com>
Cc: John Reiser <jreiser@bitwagon.com>, binutils@sourceware.org
Subject: Re: gold patch committed (Was: Re: Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel)
Date: Fri, 23 Apr 2010 17:57:00 -0000 [thread overview]
Message-ID: <z2w6dc9ffc81004231057u2260d469ue6c83000ab942a77@mail.gmail.com> (raw)
In-Reply-To: <mcrbpdauq1u.fsf@dhcp-172-17-9-151.mtv.corp.google.com>
On Fri, Apr 23, 2010 at 8:49 AM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Fri, Apr 23, 2010 at 8:16 AM, Ian Lance Taylor <iant@google.com> wrote:
>>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>>
>>>> Program Headers:
>>>> Type Offset VirtAddr PhysAddr
>>>> FileSiz MemSiz Flags Align
>>>> LOAD 0x0000000000001000 0x0000000000000000 0x0000000000000000
>>>> 0x0000000000000001 0x0000000000000001 R E 1000
>>>> LOAD 0x0000000000002000 0x0000000000004000 0x0000000000004000
>>>> 0x0000000000002001 0x0000000000002001 RW 4000
>>>
>>> This looks right to me.
>>>
>>>
>>>> I am not sure it is a good idea to have different p_align.
>>>
>>> Why not? How else can we communicate the information requested by the
>>> programmer? A system which cares about p_align needs to look at the
>>> p_align of each PT_LOAD header.
>>
>> You can't load the first segment with 0x1000 alignment. You
>> need to load the first segment with the alignment of the second
>> segment. Why does gold have to make life harder for loader?
>
> The Linux kernel doesn't look at the p_align field, nor should it.
> The p_align field is clearly irrelevant when loading an executable.
> The glibc dynamic linker checks that the p_align field looks
> plausible, but otherwise ignores it other than for a PT_TLS segment;
> that seems appropriate since ld.so is restricted to what mmap does
> anyhow. In general, it's hard for me to think of why any loader on a
> virtual memory system would look at the p_align field. And it's hard
> for to think of any non-virtual memory system that would support ELF
> style shared libraries.
>
> So I think you are raising a purely hypothetical concern.
>
> On the other hand the p_align field does convey information about the
> sections in that particular segment, and that seems reasonable to me.
>
See:
http://www.sourceware.org/bugzilla/show_bug.cgi?id=11533
--
H.J.
next prev parent reply other threads:[~2010-04-23 17:57 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-09 19:25 Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel Török Edwin
2010-04-09 22:24 ` Ian Lance Taylor
2010-04-09 22:52 ` Doug Kwan (關振德)
2010-04-10 12:52 ` Török Edwin
2010-04-11 18:25 ` John Reiser
2010-04-12 9:39 ` Török Edwin
2010-04-12 15:17 ` John Reiser
2010-04-12 18:52 ` Török Edwin
2010-04-12 20:49 ` John Reiser
2010-04-13 5:27 ` Ian Lance Taylor
2010-04-22 21:10 ` H.J. Lu
2010-04-22 21:21 ` H.J. Lu
2010-04-22 21:27 ` Suresh Siddha
2010-04-23 0:00 ` Ian Lance Taylor
2010-04-23 0:24 ` H.J. Lu
2010-04-23 1:21 ` Ian Lance Taylor
2010-04-23 1:46 ` H.J. Lu
2010-04-23 1:58 ` David Miller
2010-04-23 2:38 ` H.J. Lu
2010-04-23 3:05 ` Ian Lance Taylor
2010-04-23 4:27 ` H.J. Lu
2010-04-22 21:25 ` John Reiser
2010-04-23 4:49 ` gold patch committed (Was: Re: Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel) Ian Lance Taylor
2010-04-23 12:44 ` H.J. Lu
2010-04-23 14:12 ` Ian Lance Taylor
2010-04-23 14:35 ` H.J. Lu
2010-04-23 14:43 ` Ian Lance Taylor
2010-04-23 14:47 ` H.J. Lu
2010-04-23 15:31 ` Ian Lance Taylor
2010-04-23 15:39 ` H.J. Lu
2010-04-23 14:44 ` H.J. Lu
2010-04-23 15:16 ` Ian Lance Taylor
2010-04-23 15:30 ` H.J. Lu
2010-04-23 15:50 ` Ian Lance Taylor
2010-04-23 17:57 ` H.J. Lu [this message]
2010-04-23 15:55 ` John Reiser
2010-04-23 14:40 ` John Reiser
2010-04-23 14:02 ` Török Edwin
2010-04-23 14:48 ` H.J. Lu
2010-04-23 14:51 ` Török Edwin
2010-04-23 23:30 ` Ian Lance Taylor
2010-04-24 7:29 ` Török Edwin
2010-04-22 23:57 ` Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel Ian Lance Taylor
2010-04-12 17:48 ` Ian Lance Taylor
2010-04-12 18:04 ` Török Edwin
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=z2w6dc9ffc81004231057u2260d469ue6c83000ab942a77@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.org \
--cc=iant@google.com \
--cc=jreiser@bitwagon.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).