powerpc relax_section and section contents cache
authorAlan Modra <amodra@gmail.com>
Sat, 8 Feb 2014 01:56:53 +0000 (12:26 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 9 Feb 2014 12:55:14 +0000 (23:25 +1030)
commit53291d1f1601d6958248dcfb755af470521c186a
tree6c7d8b35b6792238cc852ff9e3866f154c77f8e2
parentf9e7e5d3e6b8715d702cf0d530e8ca6cd243cd8b
powerpc relax_section and section contents cache

This patch provides a means for backend relax_section support to
increase the size of a section without needing to reallocate
section contents.  This helps reduce memory usage when the added space
does not need to be written in relax_section, as is the case for
powerpc.  Writing the stubs later means a few tweaks are needed in the
powerpc relocate_section function, but also removes some code
duplication since the extra ld -r relocs can be written there too.

* elf-bfd.h (struct elf_backend_data): Add caches_rawsize.
* elfxx-target.h (elf_backend_caches_rawsize): Define.
(elfNN_bed): Init new field.
* elflink.c (elf_link_input_bfd): Handle caches_rawsize.
* elf32-ppc.c (shared_stub_entry): Zero addi offset.
(ppc_elf_relax_section): Don't reallocate section here, write
stubs, or write out relocs for ld -r here..
(ppc_elf_relocate_section): ..instead write stubs here, and use
existing code to write out relocs for ld -r.  Fix offset
adjustment on reloc for little-endian.
(elf_backend_caches_rawsize): Define.
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf32-ppc.c
bfd/elflink.c
bfd/elfxx-target.h
This page took 0.025276 seconds and 4 git commands to generate.