From 360c8b9c5c6424c753131c7253da393fa6aab71f Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 24 Mar 2012 10:08:46 -0400 Subject: fix operation on Linux, where the deprecated elf_getshstrndx API simply returns the value from elf_getshdrstrndx, which is 0 in my simple test case, and is interpreted as an error. Switch to the newer API and check for the definitive -1 value as the error indicator. --- libdwarf/dwarf_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdwarf/dwarf_init.c b/libdwarf/dwarf_init.c index 8fd5761..7749345 100644 --- a/libdwarf/dwarf_init.c +++ b/libdwarf/dwarf_init.c @@ -610,7 +610,7 @@ dwarf_elf_read(Dwarf_Debug dbg, Dwarf_Error *error) } /* Get the section index to the string table. */ - if (elf_getshstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == 0) { + if (elf_getshdrstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == -1) { DWARF_SET_ELF_ERROR(error, elf_errno()); return DWARF_E_ELF; } -- cgit v1.2.3