aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-rx.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-11-18 17:09:01 +1030
committerAlan Modra <amodra@gmail.com>2019-11-18 22:06:09 +1030
commit6d6c25c8eaaf42755a759beeb2996502322b960c (patch)
tree3ec735f2069634d339bde6d46dab7a7c758eb164 /bfd/elf32-rx.c
parent9aea1e31371a883452e80bd96e8818289c3e6b6e (diff)
downloadbinutils-6d6c25c8eaaf42755a759beeb2996502322b960c.zip
binutils-6d6c25c8eaaf42755a759beeb2996502322b960c.tar.gz
binutils-6d6c25c8eaaf42755a759beeb2996502322b960c.tar.bz2
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 <elf_backend_modify_headers>): 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.
Diffstat (limited to 'bfd/elf32-rx.c')
-rw-r--r--bfd/elf32-rx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index 7978244..a1a5ce1 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -3684,8 +3684,7 @@ rx_final_link (bfd * abfd, struct bfd_link_info * info)
}
static bfd_boolean
-elf32_rx_modify_program_headers (bfd * abfd ATTRIBUTE_UNUSED,
- struct bfd_link_info * info ATTRIBUTE_UNUSED)
+elf32_rx_modify_headers (bfd *abfd, struct bfd_link_info *info)
{
const struct elf_backend_data * bed;
struct elf_obj_tdata * tdata;
@@ -3717,7 +3716,7 @@ elf32_rx_modify_program_headers (bfd * abfd ATTRIBUTE_UNUSED,
#endif
}
- return TRUE;
+ return _bfd_elf_modify_headers (abfd, info);
}
/* The default literal sections should always be marked as "code" (i.e.,
@@ -4037,7 +4036,7 @@ rx_additional_link_map_text (bfd *obfd, struct bfd_link_info *info, FILE *mapfil
#define elf_backend_relocate_section rx_elf_relocate_section
#define elf_symbol_leading_char ('_')
#define elf_backend_can_gc_sections 1
-#define elf_backend_modify_program_headers elf32_rx_modify_program_headers
+#define elf_backend_modify_headers elf32_rx_modify_headers
#define bfd_elf32_bfd_reloc_type_lookup rx_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup rx_reloc_name_lookup