readelf: memory leaks in process_dynamic_section
This fixes some code that assumed only one PT_LOAD would contain
DT_SYMTAB. Which is normally the case, but fuzzers thoroughly mess
with object files.
* readelf.c (get_num_dynamic_syms): Check for nbuckets and nchains
non-zero.
(process_dynamic_section): Call get_num_dynamic_syms once rather
than in segment loop. Break out of segment loop on a successful
load of dynamic symbols. Formatting.
(process_object): Return error status from process_dynamic_section.