summaryrefslogtreecommitdiffstats
path: root/libelf/elf32_offscn.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2005-08-13 03:37:49 +0000
committerRoland McGrath <[email protected]>2005-08-13 03:37:49 +0000
commite9c4e8ec6f1b13018bfb2e42a20cd80c6bbd0498 (patch)
treeb6c5f726af9c709a7c247c684134b461df22fe72 /libelf/elf32_offscn.c
parentf8873cb86317d18399593eb95947e0c543bc9d72 (diff)
libelf/
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.
Diffstat (limited to 'libelf/elf32_offscn.c')
-rw-r--r--libelf/elf32_offscn.c7
1 files changed, 6 insertions, 1 deletions
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;