diff options
author | Roland McGrath <roland@redhat.com> | 2008-03-26 20:51:59 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2008-03-26 20:51:59 +0000 |
commit | d11f9cbecac4a5ac3848a68597028d1924f3ff6b (patch) | |
tree | bebe015f7e02d133fa3dec01f3d34c76fdb74756 /libdwfl/dwfl_module_getdwarf.c | |
parent | 472b20d24ffbc2485f8a5e2be208a11d77e8e846 (diff) | |
download | android_external_elfutils-d11f9cbecac4a5ac3848a68597028d1924f3ff6b.tar.gz android_external_elfutils-d11f9cbecac4a5ac3848a68597028d1924f3ff6b.tar.bz2 android_external_elfutils-d11f9cbecac4a5ac3848a68597028d1924f3ff6b.zip |
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.c | 8 |
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; |