summaryrefslogtreecommitdiff
path: root/libdwfl/dwfl_module_getdwarf.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-03-26 20:51:59 +0000
committerRoland McGrath <roland@redhat.com>2008-03-26 20:51:59 +0000
commitd11f9cbecac4a5ac3848a68597028d1924f3ff6b (patch)
treebebe015f7e02d133fa3dec01f3d34c76fdb74756 /libdwfl/dwfl_module_getdwarf.c
parent472b20d24ffbc2485f8a5e2be208a11d77e8e846 (diff)
downloadelfutils-d11f9cbecac4a5ac3848a68597028d1924f3ff6b.tar.gz
libdwfl/
* dwfl_module_getdwarf.c (load_symtab): Don't return success for SHT_DYNSYM, just set *SYMSCN like the comment says.
Diffstat (limited to 'libdwfl/dwfl_module_getdwarf.c')
-rw-r--r--libdwfl/dwfl_module_getdwarf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
index 7dd9b53f..38bffe58 100644
--- a/libdwfl/dwfl_module_getdwarf.c
+++ b/libdwfl/dwfl_module_getdwarf.c
@@ -218,6 +218,7 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
Elf_Scn **symscn, Elf_Scn **xndxscn,
size_t *syments, GElf_Word *strshndx)
{
+ bool symtab = false;
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (file->elf, scn)) != NULL)
{
@@ -226,6 +227,7 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
switch (shdr->sh_type)
{
case SHT_SYMTAB:
+ symtab = true;
*symscn = scn;
*symfile = file;
*strshndx = shdr->sh_link;
@@ -235,6 +237,8 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
break;
case SHT_DYNSYM:
+ if (symtab)
+ break;
/* Use this if need be, but keep looking for SHT_SYMTAB. */
*symscn = scn;
*symfile = file;
@@ -244,7 +248,7 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
case SHT_SYMTAB_SHNDX:
*xndxscn = scn;
- if (*symscn != NULL)
+ if (symtab)
return DWFL_E_NOERROR;
break;
@@ -253,7 +257,7 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
}
}
- if (*symscn != NULL)
+ if (symtab)
/* We found one, though no SHT_SYMTAB_SHNDX to go with it. */
return DWFL_E_NOERROR;