linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Chris Friesen <chris.friesen@genband.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>, linuxppc-dev@lists.ozlabs.org
Subject: Re: weird elf header issues, is it binutils or my linker script?
Date: Mon, 01 Apr 2013 09:02:24 -0600	[thread overview]
Message-ID: <5159A180.90000@genband.com> (raw)
In-Reply-To: <1AEA14BF-7AFA-43F4-8082-F0D3031C60A8@kernel.crashing.org>

On 03/29/2013 06:01 AM, Segher Boessenkool wrote:
>> PHDRS
>> {
>> headers PT_PHDR PHDRS ;
>> interp PT_INTERP ;
>> <snip>
>> }
>>
>> SECTIONS
>> {
>> /* Read-only sections, merged into text segment: */
>> PROVIDE (__executable_start = 0xf2000000); . = 0xf2000000 +
>> SIZEOF_HEADERS;
>> .interp : { *(.interp) } :text :interp
>> <snip>
>> }
>>
>> So I'm wondering...is this something wrong with our linker script,
>> or is there a bug in our binutils? I'm no linker expert, but the
>> interpreter sections in the script seem to match the binutils
>> documentation that I found and I don't see anything that would be
>> messing with the length.
>>
>> Any suggestions on where to look?
>
> It looks like your .interp input section lacks the required
> zero-termination.

That's the weird thing....the actual interpreter string "/lib/ld.so.1" 
is in fact null-terminated, but the length in the elf headers is 
incorrect (0x30 instead of 0xd) and so when the kernel checks the last 
character in the array it sees a nonzero value.

What I don't understand is where the "/lib/ld.so.1" string is coming 
from and how the length gets set to the invalid value.

Chris

  reply	other threads:[~2013-04-01 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 15:04 weird elf header issues, is it binutils or my linker script? Chris Friesen
2013-03-29 12:01 ` Segher Boessenkool
2013-04-01 15:02   ` Chris Friesen [this message]
2013-04-02 15:07     ` Segher Boessenkool
2013-04-04 22:24       ` Chris Friesen

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=5159A180.90000@genband.com \
    --to=chris.friesen@genband.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=segher@kernel.crashing.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 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 NNTP newsgroup(s).