aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-02-20 13:08:29 +0000
committerNick Clifton <nickc@redhat.com>2020-02-20 13:08:29 +0000
commit00e49dff20421e0f8f28ee74cec12a0bae8f1b82 (patch)
treeb5ad074f9e41fd5fdcdfae88cfac0c517b4a79f8 /bfd/elf-bfd.h
parentd13c7322fe1266984024644154003a19664610ea (diff)
downloadgdb-00e49dff20421e0f8f28ee74cec12a0bae8f1b82.zip
gdb-00e49dff20421e0f8f28ee74cec12a0bae8f1b82.tar.gz
gdb-00e49dff20421e0f8f28ee74cec12a0bae8f1b82.tar.bz2
Stop the BFD library from automatically converting OS and PROC specific symbol section indicies to SHN_ABS, and provide a hook for backends to decide how such indicies should be processed.
* elf-bfd.h (struct elf_backend_data): Add symbol_section_index callback. * elfxx-target.h (elf_backend_symbol_section_index): Provide default definition. (elfNN_bed): Initialise the symbol_section_index field. * elf.c (swap_out_syms): Call symbol_section_index, if defined, on OS and PROC specific section indicies. Warn if converting other reserved incidies to SHN_ABS.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index cbbba15..7d36e23 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1503,6 +1503,12 @@ struct elf_backend_data
/* Opcode representing no unwind. */
int (*cant_unwind_opcode) (struct bfd_link_info *);
+ /* Called when emitting an ELF symbol whoes input version had an
+ ST_SHNDX field set to a value in the range SHN_LOPROC..SHN_HIOS.
+ Returns the value to be installed in the ST_SHNDX field of the
+ emitted symbol. If not defined, the value is left unchanged. */
+ unsigned int (*symbol_section_index) (bfd *, elf_symbol_type *);
+
/* This is non-zero if static TLS segments require a special alignment. */
unsigned static_tls_alignment;