coping with PT_PHDR not being in loaded segment

Ian Lance Taylor ian@airs.com
Fri May 7 07:13:00 GMT 1999


   From: Ulrich Drepper <drepper@cygnus.com>
   Date: 06 May 1999 23:59:48 -0700

   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?

The issue arose in a testsuite case.  The point is that ELF does not
require a PT_PHDR segment, and it does not require that the program
headers be in loadable memory, so the dynamic linker ought to support
this unusual case.

Ian



More information about the Libc-hacker mailing list