This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: coping with PT_PHDR not being in loaded segment
- To: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- Subject: Re: coping with PT_PHDR not being in loaded segment
- From: Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
- Date: 11 May 1999 10:21:04 +0200
- Cc: drepper@cygnus.com (Ulrich Drepper), Roland McGrath <roland@frob.com>, GNU libc hacker <libc-hacker@gnu.org>, ian@cygnus.com
- References: <Roland McGrath's message of "Thu, 6 May 1999 17:04:03 -0400"> <199905062104.RAA04256@baalperazim.frob.com> <4.2.0.37.19990510164906.03643260@mail.lauterbach.com>
Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
|> At 08:59 07.05.99 , Ulrich Drepper wrote:
|> >Roland McGrath <roland@frob.com> writes:
|> >
|> > > I think I agree with Ian's analysis here. The current libc (elf/dl-load.c)
|> > > still behaves the way he described for 2.0.7. If the phdr is not visible
|> > > in the loaded image, then I think we should make a malloc'd copy to save in
|> > > the l_phdr pointer.
|> >
|> >I've made appropriate changes now. They'll be in 2.1.1pre3. But I
|> >nevertheless think that adding the phdr to a segment is a good idea.
|> >The phdr is always needed so why not load it?
|>
|> Has anyone successfully verified on any platform that the fix works? I
|> still get the FAIL "FAIL: shared (non PIC, load offset)" in the
|> ld-testsuite of gas-990418 on powerpc-linux-gnu. But now the testcase
|> segfaults instead of printing "BUG in dynamic linker".
I think this is a bug in the testsuite. The linker script elf-offset.ld
sets the load offset without taking the headers into account, which causes
the linker to add padding to make it page aligned. Could you please try
this patch?
Andreas.
Tue May 11 10:19:52 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* ld-shared/elf-offset.ld: Add SIZEOF_HEADERS to start address.
--- binutils/ld/testsuite/ld-shared/elf-offset.ld.~1~ Mon May 3 09:29:09 1999
+++ binutils/ld/testsuite/ld-shared/elf-offset.ld Tue May 11 10:17:50 1999
@@ -1,7 +1,7 @@
SECTIONS
{
/* Read-only sections, merged into text segment: */
- . = 0x100000;
+ . = 0x100000 + SIZEOF_HEADERS;
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org