support parsing of dynamic ELFs w/out section headers
At runtime, ELFs do not use the section headers at all. Instead, only
the program segments and dynamic tags get used. This means you can
strip the section table completely from an ELF and have it still work.
In practice, people rarely do this, but it's not unheard of. Make the
Dynamic tags work even in these cases by loading the strings table the
same way the runtime loader does:
- parse the symtab address from DT_STRTAB
- locate the file offset via the program segments
In order to avoid circular deps (parsing a dyntag requires walking parsed
dyntags), add a set of internal funcs for returning the raw values.
TEST=lddtree w/build_image works on heavily stripped files (like netflix)
Reviewed-by: David James <firstname.lastname@example.org>
Commit-Queue: Mike Frysinger <email@example.com>
Tested-by: Mike Frysinger <firstname.lastname@example.org>
1 file changed