eliben/pyelftools — pull request #10 by yannrouillard (2013-07-09 16:41:50+00:00)
Title: Correctly handle the "multiple string tables" case for string resolution...

Hi Eli,

Here is a little fix for a problem I've met with an elf file containing two 'dynstr' sections.
pyelftools was crashing while iterating throught dynamic tags because it looked for the string table using the 'dynstr' name and picked the wrong one.

After some research, it seems that the good string table to use is given by the DT_STRTAB dynamic tag in the dynamic table itself.
The following patch changes the dynamic section code so it finds and use the string table section pointed at by this DT_STRTAB dynamic tag.

Yann