From 6d6c25c8eaaf42755a759beeb2996502322b960c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 18 Nov 2019 17:09:01 +1030 Subject: elf_backend_modify_headers This patch renames elf_backend_modify_program_headers and moves the elf.c code tweaking the ELF file header for -pie -Ttext-segment to a new function, _bfd_elf_modify_headers, which then becomes the default elf_backed_modify_headers and is called from any other target elf_backed_modify_headers. * elf-bfd.h (struct elf_backend_data ): Rename from elf_backend_modify_program_headers. (_bfd_elf_modify_headers): Declare. * elf.c (assign_file_positions_except_relocs): Set elf_program_header_size. Always call elf_backend_modify_headers. Extract code modifying file header.. (_bfd_elf_modify_headers): ..to here. New function. * elf32-arm.c (elf_backend_modify_headers): Renamed from elf_backend_modify_program_headers. * elf32-i386.c: Similarly. * elf64-x86-64.c: Similarly. * elfxx-target.h: Similarly. Default elf_backend_modify_headers to _bfd_elf_modify_headers. * elf-nacl.h (nacl_modify_headers): Rename from nacl_modify_program_headers. * elf-nacl.c (nacl_modify_headers): Rename from nacl_modify_program_headers and call _bfd_elf_modify_headers. * elf32-rx.c (elf32_rx_modify_headers): Similarly. * elf32-spu.c (spu_elf_modify_headers): Similarly. * elfnn-ia64.c (elfNN_ia64_modify_headers): Similarly. * elf32-sh.c (elf_backend_modify_program_headers): Don't undef. --- bfd/elf32-sh.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'bfd/elf32-sh.c') diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index c572f70..c10691e 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -6847,8 +6847,6 @@ sh_elf_encode_eh_address (bfd *abfd, #include "elf32-target.h" -#undef elf_backend_modify_program_headers - /* VxWorks support. */ #undef TARGET_BIG_SYM #define TARGET_BIG_SYM sh_elf32_vxworks_vec -- cgit v1.1