PR ld/16787, stale dwarf2 stash
authorAlan Modra <amodra@gmail.com>
Wed, 23 Apr 2014 04:56:19 +0000 (14:26 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 23 Apr 2014 04:59:12 +0000 (14:29 +0930)
commitcd0449ab05e9045682a81bf521bd0c8732c98feb
tree917a1dc69ab0ad11ba9e78bfa0aa251e1fd0e00a
parent1547d98f5a774617b38f2bdd9be3b5c21c2b9312
PR ld/16787, stale dwarf2 stash

Throw away the dwarf2 stash if it becomes invalid due to section
VMAs changing.  It would be nice to reclaim all the bfd_alloc
memory here when we throw away the stash, perhaps by putting
everything we alloc on a private dwarf2 objalloc, but I haven't done
that with this patch.

I've also fixed a problem with bfd_perform_relocation losing reloc
addends, which meant a second or subsequent look at debug info
sections did not properly relocate the sections.  I can't see why
bfd_perform_relocation should need to change addends except for ld -r,
and the history (985fca12e98e6ec1) doesn't help much.

Finally, the patch tweaks place_sections to avoid unnecessary work.
If we've mapped input to output sections, then input section VMA
isn't used so there's not much point in adjusting it.  Incidentally,
this also means place_sections isn't effective in all cases.

PR ld/16787
* dwarf2.c (struct dwarf2_debug): Add sec_vma field.
(place_sections): Do not modify VMA of sections when called from
linker after sections have been placed in output sections.  Short
circuit single section case.
(save_section_vma, section_vma_same): New functions.
(_bfd_dwarf2_slurp_debug_info): Throw away stash if section VMAs
change.
* reloc.c (bfd_perform_relocation): Do not modify reloc addend
when non-relocatable.
bfd/ChangeLog
bfd/dwarf2.c
bfd/reloc.c
This page took 0.02608 seconds and 4 git commands to generate.