]> sourceware.org Git - glibc.git/commitdiff
ld.so: Don't fill the DT_DEBUG entry in ld.so [BZ #28129]
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 2 Aug 2021 20:52:36 +0000 (13:52 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 6 Oct 2021 16:02:21 +0000 (09:02 -0700)
Linker creates the DT_DEBUG entry only in executables.  Don't fill the
non-existent DT_DEBUG entry in ld.so with the run-time address of the
r_debug structure.  This fixes BZ #28129.

elf/rtld.c

index 9642eb9c92d56614390b01d0c39e334fe6bb872c..628245d8cd1cc9d40ede52b0c804a59ddf3f2d3f 100644 (file)
@@ -1761,17 +1761,11 @@ dl_main (const ElfW(Phdr) *phdr,
 #ifdef ELF_MACHINE_DEBUG_SETUP
   /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way.  */
   ELF_MACHINE_DEBUG_SETUP (main_map, r);
-  ELF_MACHINE_DEBUG_SETUP (&GL(dl_rtld_map), r);
 #else
   if (main_map->l_info[DT_DEBUG] != NULL)
     /* There is a DT_DEBUG entry in the dynamic section.  Fill it in
        with the run-time address of the r_debug structure  */
     main_map->l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
-
-  /* Fill in the pointer in the dynamic linker's own dynamic section, in
-     case you run gdb on the dynamic linker directly.  */
-  if (GL(dl_rtld_map).l_info[DT_DEBUG] != NULL)
-    GL(dl_rtld_map).l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
 #endif
 
   /* We start adding objects.  */
This page took 0.046287 seconds and 5 git commands to generate.