diff options
author | Alan Modra <amodra@gmail.com> | 2014-04-23 14:26:19 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-04-23 14:29:12 +0930 |
commit | cd0449ab05e9045682a81bf521bd0c8732c98feb (patch) | |
tree | 917a1dc69ab0ad11ba9e78bfa0aa251e1fd0e00a /bfd/reloc.c | |
parent | 1547d98f5a774617b38f2bdd9be3b5c21c2b9312 (diff) | |
download | gdb-cd0449ab05e9045682a81bf521bd0c8732c98feb.zip gdb-cd0449ab05e9045682a81bf521bd0c8732c98feb.tar.gz gdb-cd0449ab05e9045682a81bf521bd0c8732c98feb.tar.bz2 |
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 (985fca12, e98e6ec1) 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.
Diffstat (limited to 'bfd/reloc.c')
-rw-r--r-- | bfd/reloc.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/bfd/reloc.c b/bfd/reloc.c index bc6b393..7f46c58 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -784,10 +784,6 @@ space consuming. For each target: } } } - else - { - reloc_entry->addend = 0; - } /* FIXME: This overflow checking is incomplete, because the value might have overflowed before we get here. For a correct check we |