ARC naughtiness causing assertion fail at elf-strtab.c:302
authorAlan Modra <amodra@gmail.com>
Sat, 25 Feb 2017 05:14:29 +0000 (15:44 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 25 Feb 2017 08:11:03 +0000 (18:41 +1030)
commit034fed0bbc3541d2a11a839faf4be521843ad954
treefcd3f0ec3a1dc5e70e11ee3f2fe0112b6dfb67e3
parent7cc14406548d299c1371ecdc2d43592c98567a0b
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.
bfd/ChangeLog
bfd/elf32-arc.c
This page took 0.036155 seconds and 4 git commands to generate.