aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-target.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-02-08 12:26:53 +1030
committerAlan Modra <amodra@gmail.com>2014-02-09 23:25:14 +1030
commit53291d1f1601d6958248dcfb755af470521c186a (patch)
tree6c7d8b35b6792238cc852ff9e3866f154c77f8e2 /bfd/elfxx-target.h
parentf9e7e5d3e6b8715d702cf0d530e8ca6cd243cd8b (diff)
downloadgdb-53291d1f1601d6958248dcfb755af470521c186a.zip
gdb-53291d1f1601d6958248dcfb755af470521c186a.tar.gz
gdb-53291d1f1601d6958248dcfb755af470521c186a.tar.bz2
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.
Diffstat (limited to 'bfd/elfxx-target.h')
-rw-r--r--bfd/elfxx-target.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 2e7cbca..74e1b32 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -109,6 +109,9 @@
#ifndef elf_backend_default_execstack
#define elf_backend_default_execstack 1
#endif
+#ifndef elf_backend_caches_rawsize
+#define elf_backend_caches_rawsize 0
+#endif
#ifndef elf_backend_stack_align
#define elf_backend_stack_align 16
#endif
@@ -794,7 +797,8 @@ static struct elf_backend_data elfNN_bed =
elf_backend_want_got_sym,
elf_backend_want_dynbss,
elf_backend_want_p_paddr_set_to_zero,
- elf_backend_default_execstack
+ elf_backend_default_execstack,
+ elf_backend_caches_rawsize
};
/* Forward declaration for use when initialising alternative_target field. */