]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libelf/
authorRoland McGrath <roland@redhat.com>
Sat, 13 Aug 2005 03:37:49 +0000 (03:37 +0000)
committerRoland McGrath <roland@redhat.com>
Sat, 13 Aug 2005 03:37:49 +0000 (03:37 +0000)
2005-08-12  Roland McGrath  <roland@redhat.com>

* elf32_offscn.c: Do not match empty sections at OFFSET unless
there are no nonempty sections at that offset.

libelf/ChangeLog
libelf/elf32_offscn.c

index aa2a0b11b273940b409e217aa1cb5310dd7591a4..67d4f39510ab37e6255a1e08a74420658c9727ef 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-12  Roland McGrath  <roland@redhat.com>
+
+       * elf32_offscn.c: Do not match empty sections at OFFSET unless
+       there are no nonempty sections at that offset.
+
 2005-08-07  Ulrich Drepper  <drepper@redhat.com>
 
        * elf.h: Update from glibc.
index 8a803b76b6abc4bb810b7df5cc5ff62904cfe87e..843f8b00b52e54193c74ed97eb37f40da64b9eaf 100644 (file)
@@ -56,7 +56,12 @@ elfw2(LIBELFBITS,offscn) (elf, offset)
        if (runp->data[i].shdr.ELFW(e,LIBELFBITS)->sh_offset == offset)
          {
            result = &runp->data[i];
-           goto out;
+
+           /* If this section is empty, the following one has the same
+              sh_offset.  We presume the caller is looking for a nonempty
+              section, so keep looking if this one is empty.  */
+           if (runp->data[i].shdr.ELFW(e,LIBELFBITS)->sh_size != 0)
+             goto out;
          }
 
       runp = runp->next;