about summary refs log tree commit diff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-16 07:00:05 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-16 07:00:05 +0000
commit553eca268c4d06b0c0c5966b1b8a0b01cd80cc02 (patch)
treece87efe533fc6249ec0f9fb9fda0a6e775a34c29 /elf/rtld.c
parent452aea842fc43f2652ec352ab71e855e69057e5d (diff)
downloadglibc-553eca268c4d06b0c0c5966b1b8a0b01cd80cc02.tar.gz
glibc-553eca268c4d06b0c0c5966b1b8a0b01cd80cc02.tar.xz
glibc-553eca268c4d06b0c0c5966b1b8a0b01cd80cc02.zip
Update.
	* elf/dl-iteratephdr.c (__dl_iterate_phdr): Don't skip dynamic
	linker's map.
	* elf/rtld.c (dl_main): Initialize l_phdr and l_phnum of of the
	dynamic linker's map.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 367a9dcba9..5347a5f7b8 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -931,6 +931,13 @@ of this helper program; chances are you did not intend to run this program.\n\
   GL(dl_rtld_map).l_prev = GL(dl_loaded);
   ++GL(dl_nloaded);
 
+  /* Set up the program header information for the dynamic linker
+     itself.  It is needed in the dl_iterate_phdr() callbacks.  */
+  ElfW(Ehdr) *rtld_ehdr = (ElfW(Ehdr) *) GL(dl_rtld_map.l_addr);
+  GL(dl_rtld_map).l_phdr = (ElfW(Phdr) *) (GL(dl_rtld_map.l_addr)
+					   + rtld_ehdr->e_phoff);
+  GL(dl_rtld_map).l_phnum = rtld_ehdr->e_phnum;
+
   /* We have two ways to specify objects to preload: via environment
      variable and via the file /etc/ld.so.preload.  The latter can also
      be used when security is enabled.  */