libdw: dwarf_begin_elf should use elf_getshdrstrndx to get section names.
authorMark Wielaard <mark@klomp.org>
Sat, 4 Aug 2018 20:34:32 +0000 (22:34 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 13 Sep 2018 22:20:49 +0000 (00:20 +0200)
commitb14633d41673bb1903c887cb9ffd55fe700c4eb1
treedcd91404f2f7ad1b57189864470abe40d5cd5c3c
parent583d106753e805e75a6cbfeab79aa2965e042f69
libdw: dwarf_begin_elf should use elf_getshdrstrndx to get section names.

dwarf_begin_elf used the Ehdr e_shstrndx to get the shdr string table
section. This does not work for ELF files with more than SHN_LORESERVE
sections. Use elf_getshdrstrndx, and don't pass around the ehdr.

Add a simple testcase that fails before the patch because dwarf_begin
return an error.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_begin_elf.c
tests/ChangeLog
tests/Makefile.am
tests/run-typeiter-many.sh [new file with mode: 0755]