aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-01-06 09:24:41 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-01-12 06:04:51 -0800
commit23cc1de50b006fa10e295bdb4455540f001515e9 (patch)
treed25d69445f837310c737233f5987861c9ca88a49 /bfd/elf-bfd.h
parent6a91be866619c592762cd7e9b034a9f7ad27ef37 (diff)
downloadgdb-23cc1de50b006fa10e295bdb4455540f001515e9.zip
gdb-23cc1de50b006fa10e295bdb4455540f001515e9.tar.gz
gdb-23cc1de50b006fa10e295bdb4455540f001515e9.tar.bz2
elf: Add size_relative_relocs and finish_relative_relocs
On some targets, the DT_RELR section size can be computed only after all symbols addresses can be determined. Set the preliminary DT_RELR section size before mapping sections to segments and set the final DT_RELR section size after regular symbol processing is done. * elf-bfd.h (elf_backend_data): Add size_relative_relocs and finish_relative_relocs. * elf.c (_bfd_elf_map_sections_to_segments): Call size_relative_relocs if DT_RELR is enabled. * elflink.c (bfd_elf_final_link): Call finish_relative_relocs after regular symbol processing is finished if DT_RELR is enabled. * elfxx-target.h (elf_backend_size_relative_relocs): New. (elf_backend_finish_relative_relocs): Likewise. (elfNN_bed): Add elf_backend_size_relative_relocs and elf_backend_finish_relative_relocs.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 7808f87..4a85255 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1105,6 +1105,16 @@ struct elf_backend_data
(bfd *abfd, struct bfd_link_info *info, asection *o,
const Elf_Internal_Rela *relocs);
+ /* The SIZE_RELATIVE_RELOCS function is called to size relative
+ relocations when mappig sections to segments. */
+ bool (*size_relative_relocs)
+ (struct bfd_link_info *info, bool *need_layout);
+
+ /* The FINISH_RELATIVE_RELOCS function is called to finish relative
+ relocations in bfd_elf_final_link. */
+ bool (*finish_relative_relocs)
+ (struct bfd_link_info *info);
+
/* The CHECK_DIRECTIVES function is called once per input file by
the add_symbols phase of the ELF backend linker. The function
must inspect the bfd and create any additional symbols according