summaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-11-10 00:23:35 +0000
committerAlan Modra <amodra@bigpond.net.au>2001-11-10 00:23:35 +0000
commitb431c26ecea5983c284e14ba98651f29b498b463 (patch)
tree2b1e5cd0c7958daeab48fe2b0c6d2c7226851b3f /bfd/elf-bfd.h
parent9d8f7a70e126658e7e078fac599c938079a28638 (diff)
downloadgdb-b431c26ecea5983c284e14ba98651f29b498b463.tar.gz
* elf32-arm.h (elf32_arm_final_link_relocate): Don't copy STN_UNDEF
relocs into shared libs. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mips.c (mips_elf_calculate_relocation): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. * elf.c (bfd_section_from_r_symndx): New function. * elf-bfd.h (LOCAL_SYM_CACHE_SIZE): Define. (struct sym_sec_cache): New. (bfd_section_from_r_symndx): Declare. (struct bfd_elf_section_data): Change local_dynrel type to PTR. * elflink.h (elf_link_input_bfd): Don't test for removed linkonce relocs when relocatable. Don't zero entire reloc, just zero the addend and sym. * elf32-i386.c (struct elf_i386_link_hash_table): Add sym_sec. (elf_i386_link_hash_table_create): Init it. (elf_i386_check_relocs): Track dynamic relocs needed for local syms on a per-section basis as we do for globals. (elf_i386_gc_sweep_hook): Update for local_dynrel change. Remove dead code. (allocate_dynrelocs): Warning fix. (elf_i386_size_dynamic_sections): Don't allocate relocs when section has been discarded. (elf_i386_relocate_section): Don't copy STN_UNDEF relocs into shared libs. * elf32-hppa.c: Likewise. * elf32-s390.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index e9a8b838368..cb79eeab69f 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -299,6 +299,16 @@ struct elf_link_hash_table
/* Returns true if the hash table is a struct elf_link_hash_table. */
#define is_elf_hash_table(p) \
((p)->hash->type == bfd_link_elf_hash_table)
+
+/* Used by bfd_section_from_r_symndx to cache a small number of local
+ symbol to section mappings. */
+#define LOCAL_SYM_CACHE_SIZE 32
+struct sym_sec_cache
+{
+ bfd *abfd;
+ unsigned long indx[LOCAL_SYM_CACHE_SIZE];
+ asection *sec[LOCAL_SYM_CACHE_SIZE];
+};
/* Constant information held for an ELF backend. */
@@ -778,8 +788,9 @@ struct bfd_elf_section_data
/* The number of relocations currently assigned to REL_HDR2. */
unsigned int rel_count2;
- /* The number of dynamic relocs copied for local symbols. */
- unsigned int local_dynrel;
+ /* A pointer to a linked list tracking dynamic relocs copied for
+ local symbols. */
+ PTR local_dynrel;
/* A pointer to the bfd section used for dynamic relocs. */
asection *sreloc;
@@ -1198,6 +1209,8 @@ extern boolean bfd_section_from_phdr
extern int _bfd_elf_symbol_from_bfd_symbol
PARAMS ((bfd *, asymbol **));
+extern asection *bfd_section_from_r_symndx
+ PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long));
extern asection *bfd_section_from_elf_index
PARAMS ((bfd *, unsigned int));
extern boolean _bfd_elf_create_dynamic_sections