ARC naughtiness causing assertion fail at elf-strtab.c:302
This patch fixes a number of issues in the ARC backend.
- The ARC size_dynamic_sections was trashing dynamic section contents,
in particular the .gnu.version_d contents. Those versions
definitions are therefore lost so they do not drain from the strtab,
resulting in assertion failures.
- The code attempting to set DT_TEXTREL was completely bogus.
- The ARC finish_dynamic_sections would segfault on trying to set
sh_entsize for .rela.plt if that section had been discarded.
- arc_create_dynamic_sections wouldn't have ever created dynamics
sections, which was just as well since the places it was called were
way too late to create dynamic sections. Its usefulness then
devolved down to finding just one dynamic section. All the others
packaged into a struct were unused.
- .interp wasn't set for PIEs.
* elf32-arc.c (struct dynamic_sections): Delete.
(enum dyn_section_types): Delete.
(dyn_section_names): Delete.
(arc_create_dynamic_sections): Delete.
(elf_arc_finish_dynamic_sections): Don't call the above. Don't
segfault on discarded .rela.plt section.
(elf_arc_size_dynamic_sections): Formatting. Don't call
arc_create_dynamic_sections. Don't allocate memory for sections
handled by the generic linker. Correct code finding relocs in
read-only sections. Set SEC_EXCLUDE on zero size .got,
.got.plt, and .dynbss sections. Do set .interp for pies.