summaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2016-09-23 16:32:04 +0100
committerNick Clifton <nickc@redhat.com>2016-09-23 16:32:04 +0100
commit5025eb7c0d87b01507116353b5d63b163d7add3d (patch)
tree5ee96f3e2ad11fe3c7c2fd3959bd2cd6f2c7c1c9 /bfd/elf-bfd.h
parent7c4236c3505d8dca3c6d9c2bc61145fa759bf4ce (diff)
downloadbinutils-gdb-5025eb7c0d87b01507116353b5d63b163d7add3d.tar.gz
Delete relocations associatesd with deleted exidx entries.
PR ld/20595 ld * testsuite/ld-arm/unwind-4.d: Add -q option to linker command line and -r option to objdump command line. Match emitted relocs to make sure that superflous relocs are not generated. bfd * elf-bfd.h (struct elf_backend_data): Add elf_backend_count_output_relocs callback to count relocations in the final output. * elf-arm.c (elf32_arm_add_relocation): Deleted. (elf32_arm_write_section): Move additional relocation to emit_relocs. (elf32_arm_count_output_relocs): New function. (emit_relocs): New function. (elf32_arm_emit_relocs): New function. (elf32_arm_vxworks_emit_relocs): New function. (elf_backend_emit_relocs): Updated to use the new functions. (elf_backend_count_output_relocs): New define. * bfd/elflink.c (bfd_elf_final_link): Do not add additional_reloc_count to the relocation count. (_bfd_elf_link_size_reloc_section): Use callback to count the relocations which will be in output. (_bfd_elf_default_count_output_relocs): New function. * bfd/elfxx-target.h (elf_backend_count_output_relocs): New define.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index d18df17e2f6..c58bd4f9025 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1183,6 +1183,11 @@ struct elf_backend_data
unsigned int (*elf_backend_count_additional_relocs)
(asection *);
+ /* Count relocations to be output. The result may be different if the
+ input relocations are expected to be modified by the backend. */
+ unsigned int (* elf_backend_count_output_relocs)
+ (struct bfd_link_info *, asection *, bfd_boolean is_rela);
+
/* Say whether to sort relocs output by ld -r and ld --emit-relocs,
by r_offset. If NULL, default to true. */
bfd_boolean (*sort_relocs_p)
@@ -2152,6 +2157,9 @@ extern bfd_boolean _bfd_elf_link_output_relocs
(bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
struct elf_link_hash_entry **);
+extern unsigned int _bfd_elf_default_count_output_relocs
+ (struct bfd_link_info * ATTRIBUTE_UNUSED, asection *, bfd_boolean);
+
extern bfd_boolean _bfd_elf_adjust_dynamic_copy
(struct bfd_link_info *, struct elf_link_hash_entry *, asection *);