bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/22136] Support marking "debug" info files with special ET_


From: hjl.tools at gmail dot com
Subject: [Bug binutils/22136] Support marking "debug" info files with special ET_GNU_DEBUG_* values.
Date: Fri, 15 Sep 2017 20:36:04 +0000

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

--- Comment #17 from H.J. Lu <hjl.tools at gmail dot com> ---
This fixed the ld.so crash on debug file:

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]