]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Omit module sanity checks on offline modules.
authorRoland McGrath <roland@redhat.com>
Wed, 11 Feb 2009 01:33:49 +0000 (17:33 -0800)
committerRoland McGrath <roland@redhat.com>
Wed, 11 Feb 2009 01:33:49 +0000 (17:33 -0800)
libdwfl/ChangeLog
libdwfl/dwfl_report_elf.c
libdwfl/libdwflP.h
libdwfl/offline.c

index fb235c93e98bb92b96e0c7825f799f182b9a718b..11e12a35f8b8554d49ffdb76f4122be4716ebdf3 100644 (file)
@@ -1,5 +1,12 @@
 2009-02-10  Roland McGrath  <roland@redhat.com>
 
+       * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
+       If false, don't fail for NO_PHDR.
+       (dwfl_report_elf): Update caller.
+       * libdwflP.h: Update decl.
+       * offline.c (process_elf): Call it with false, so we don't refuse
+       dubiously-formed objects here.
+
        * link_map.c (consider_executable): Don't assert dwfl_addrsegment
        finds our module.  We shouldn't crash when we confuse some guesses.
 
index 9fc156fe070cc9cf03cdf74c63982d9add444a03..a58d3029983cc96fcfc64bcf869c88cc67db5a54 100644 (file)
@@ -62,7 +62,7 @@
 Dwfl_Module *
 internal_function
 __libdwfl_report_elf (Dwfl *dwfl, const char *name, const char *file_name,
-                     int fd, Elf *elf, GElf_Addr base)
+                     int fd, Elf *elf, GElf_Addr base, bool sanity)
 {
   GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
   if (ehdr == NULL)
@@ -216,7 +216,7 @@ __libdwfl_report_elf (Dwfl *dwfl, const char *name, const char *file_name,
            }
        }
 
-      if (end == 0)
+      if (end == 0 && sanity)
        {
          __libdwfl_seterrno (DWFL_E_NO_PHDR);
          return NULL;
@@ -284,7 +284,7 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
     }
 
   Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name,
-                                          fd, elf, base);
+                                          fd, elf, base, true);
   if (mod == NULL)
     {
       elf_end (elf);
index 85519498d083a3a31183d612dd473140286dbb2b..45eac21cfc00bfea2b9b982f1fbfc88adfc0b69d 100644 (file)
@@ -306,7 +306,7 @@ extern int __libdwfl_crc32_file (int fd, uint32_t *resp) attribute_hidden;
    Consumes ELF on success, not on failure.  */
 extern Dwfl_Module *__libdwfl_report_elf (Dwfl *dwfl, const char *name,
                                          const char *file_name, int fd,
-                                         Elf *elf, GElf_Addr base)
+                                         Elf *elf, GElf_Addr base, bool sanity)
   internal_function;
 
 /* Meat of dwfl_report_offline.  */
index a80e2928e3366ea9304803dd482627e9a4fbc8a7..34aa9f84a354bc2773ed69264de81800c648215d 100644 (file)
@@ -148,7 +148,7 @@ process_elf (Dwfl *dwfl, const char *name, const char *file_name, int fd,
             Elf *elf)
 {
   Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name, fd, elf,
-                                          dwfl->offline_next_address);
+                                          dwfl->offline_next_address, false);
   if (mod != NULL)
     {
       /* If this is an ET_EXEC file with fixed addresses, the address range