This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/22101] Dynamic loader must ignore "debug" shared objects e.g. ET_GNU_DEBUG_*


https://sourceware.org/bugzilla/show_bug.cgi?id=22101

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
Try this:

diff --git a/elf/dl-load.c b/elf/dl-load.c
index a067760cc6..261ec997c8 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1052,8 +1052,11 @@ _dl_map_object_from_fd (const char *name, const char
*origname, int fd,
        segments are mapped in.  We record the addresses it says
        verbatim, and later correct for the run-time load address.  */
   case PT_DYNAMIC:
-    l->l_ld = (void *) ph->p_vaddr;
-    l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
+    if (ph->p_filesz)
+      {
+        l->l_ld = (void *) ph->p_vaddr;
+        l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
+      }
     break;

   case PT_PHDR:

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]