summaryrefslogtreecommitdiffstats
path: root/libelf
diff options
context:
space:
mode:
Diffstat (limited to 'libelf')
-rw-r--r--libelf/ChangeLog5
-rw-r--r--libelf/elf32_offscn.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index aa2a0b11..67d4f395 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-12 Roland McGrath <[email protected]>
+
+ * elf32_offscn.c: Do not match empty sections at OFFSET unless
+ there are no nonempty sections at that offset.
+
2005-08-07 Ulrich Drepper <[email protected]>
* elf.h: Update from glibc.
diff --git a/libelf/elf32_offscn.c b/libelf/elf32_offscn.c
index 8a803b76..843f8b00 100644
--- a/libelf/elf32_offscn.c
+++ b/libelf/elf32_offscn.c
@@ -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;