diff options
author | Nick Clifton <nickc@redhat.com> | 2020-03-05 15:47:15 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-03-05 15:47:15 +0000 |
commit | a8e14f4cc2badfcf959f5e2cc57a941dc43f72d4 (patch) | |
tree | 444ec5de9720df67ac7202749119058278f3d9d7 /bfd/elf-bfd.h | |
parent | 842806cb6f1c321666dd086a79a0fdfbd35497ed (diff) | |
download | gdb-a8e14f4cc2badfcf959f5e2cc57a941dc43f72d4.zip gdb-a8e14f4cc2badfcf959f5e2cc57a941dc43f72d4.tar.gz gdb-a8e14f4cc2badfcf959f5e2cc57a941dc43f72d4.tar.bz2 |
Add support for ELF files which contain multiple reloc sections which all target the same section.
* elf-bfd.h (struct elf_backend_data): Add new fields:
init_secondary_reloc_section, slurp_secondary_reloc_section,
write_secondary_reloc_section.
(_bfd_elf_init_secondary_reloc_section): Prototype.
(_bfd_elf_slurp_secondary_reloc_section): Prototype.
(_bfd_elf_write_secondary_reloc_section): Prototype.
* elf.c ( bfd_section_from_shdr): Invoke the new
init_secondary_reloc_section backend function, if defined, when a
second reloc section is encountered.
(swap_out_syms): Invoke the new symbol_section_index function, if
defined, when computing the section index of an OS/PROC specific
symbol.
(_bfd_elf_init_secondary_reloc_section): New function.
(_bfd_elf_slurp_secondary_reloc_section): New function.
(_bfd_elf_write_secondary_reloc_section): New function.
(_bfd_elf_copy_special_section_fields): New function.
* elfcode.h (elf_write_relocs): Invoke the new
write_secondary_relocs function, if defined, in order to emit
secondary relocs.
(elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
function, if defined, in order to read in secondary relocs.
* elfxx-target.h (elf_backend_copy_special_section_fields):
Provide a non-NULL default definition.
(elf_backend_init_secondary_reloc_section): Likewise.
(elf_backend_slurp_secondary_reloc_section): Likewise.
(elf_backend_write_secondary_reloc_section): Likewise.
(struct elf_backend_data elfNN_bed): Add initialisers for the new
fields.
* configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
* configure: Regenerate.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 38a9aa0..5d9e0fe 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1509,6 +1509,16 @@ struct elf_backend_data emitted symbol. If not defined, the value is left unchanged. */ unsigned int (*symbol_section_index) (bfd *, elf_symbol_type *); + /* Called when a section has extra reloc sections. */ + bfd_boolean (*init_secondary_reloc_section) (bfd *, Elf_Internal_Shdr *, + const char *, unsigned int); + + /* Called when after loading the normal relocs for a section. */ + bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **); + + /* Called after writing the normal relocs for a section. */ + bfd_boolean (*write_secondary_relocs) (bfd *, asection *); + /* This is non-zero if static TLS segments require a special alignment. */ unsigned static_tls_alignment; @@ -2838,6 +2848,19 @@ extern bfd_vma elf32_r_sym (bfd_vma); extern bfd_boolean is_debuginfo_file (bfd *); + +extern bfd_boolean _bfd_elf_init_secondary_reloc_section + (bfd *, Elf_Internal_Shdr *, const char *, unsigned int); +extern bfd_boolean _bfd_elf_slurp_secondary_reloc_section + (bfd *, asection *, asymbol **); +extern bfd_boolean _bfd_elf_copy_special_section_fields + (const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *); +extern bfd_boolean _bfd_elf_write_secondary_reloc_section + (bfd *, asection *); +extern unsigned int _bfd_elf_symbol_section_index + (bfd *, elf_symbol_type *); + + /* Large common section. */ extern asection _bfd_elf_large_com_section; |