/* BFD back-end data structures for ELF files.
- Copyright (C) 1992-2020 Free Software Foundation, Inc.
+ Copyright (C) 1992-2021 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
is_nacl /* Native Client. */
};
+/* Used by bfd_sym_from_r_symndx to cache a small number of local
+ symbols. */
+#define LOCAL_SYM_CACHE_SIZE 32
+struct sym_cache
+{
+ bfd *abfd;
+ unsigned long indx[LOCAL_SYM_CACHE_SIZE];
+ Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
+};
+
/* ELF linker hash table. */
struct elf_link_hash_table
/* A linked list of dynamic BFD's loaded in the link. */
struct elf_link_loaded_list *dyn_loaded;
+ /* Small local sym cache. */
+ struct sym_cache sym_cache;
+
/* Short-cuts to get to dynamic linker sections. */
asection *sgot;
asection *sgotplt;
/* Returns TRUE if the hash table is a struct elf_link_hash_table. */
#define is_elf_hash_table(htab) \
(((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table)
-
-/* Used by bfd_sym_from_r_symndx to cache a small number of local
- symbols. */
-#define LOCAL_SYM_CACHE_SIZE 32
-struct sym_cache
-{
- bfd *abfd;
- unsigned long indx[LOCAL_SYM_CACHE_SIZE];
- Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
-};
\f
/* Constant information held for an ELF backend. */
(bfd *, const Elf_Internal_Rela *, bfd_byte *);
};
-#define elf_symbol_from(ABFD,S) \
- (((S)->the_bfd != NULL \
+#define elf_symbol_from(S) \
+ ((((S)->flags & BSF_SYNTHETIC) == 0 \
+ && (S)->the_bfd != NULL \
&& (S)->the_bfd->xvec->flavour == bfd_target_elf_flavour \
&& (S)->the_bfd->tdata.elf_obj_data != 0) \
? (elf_symbol_type *) (S) \
/* Merge the backend specific symbol attribute. */
void (*elf_backend_merge_symbol_attribute)
- (struct elf_link_hash_entry *, const Elf_Internal_Sym *, bfd_boolean,
- bfd_boolean);
+ (struct elf_link_hash_entry *, unsigned int, bfd_boolean, bfd_boolean);
/* This function, if defined, will return a string containing the
name of a target-specific dynamic tag. */
const char *, unsigned int);
/* Called when after loading the normal relocs for a section. */
- bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **);
+ bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
/* Called after writing the normal relocs for a section. */
bfd_boolean (*write_secondary_relocs) (bfd *, asection *);
/* Link from a text section to its .eh_frame_entry section. */
asection *eh_frame_entry;
+ /* TRUE if the section has secondary reloc sections associated with it.
+ FIXME: In the future it might be better to change this into a list
+ of secondary reloc sections, making lookup easier and faster. */
+ bfd_boolean has_secondary_relocs;
+
/* A pointer used for various section optimizations. */
void *sec_info;
};
bfd_boolean flags_init;
};
-/* Indicate if the bfd contains SHF_GNU_MBIND sections or symbols that
- have the STT_GNU_IFUNC symbol type or STB_GNU_UNIQUE binding. Used
- to set the osabi field in the ELF header structure. */
+/* Indicate if the bfd contains SHF_GNU_MBIND/SHF_GNU_RETAIN sections or
+ symbols that have the STT_GNU_IFUNC symbol type or STB_GNU_UNIQUE
+ binding. Used to set the osabi field in the ELF header structure. */
enum elf_gnu_osabi
{
elf_gnu_osabi_mbind = 1 << 0,
elf_gnu_osabi_ifunc = 1 << 1,
elf_gnu_osabi_unique = 1 << 2,
+ elf_gnu_osabi_retain = 1 << 3,
};
typedef struct elf_section_list
bfd_vma gp; /* The gp value */
unsigned int gp_size; /* The gp size */
unsigned int num_elf_sections; /* elf_sect_ptr size */
+ unsigned char *being_created;
/* A mapping from external symbols to entries in the linker hash
table, used when linking. This is indexed by the symbol index
ENUM_BITFIELD (dynamic_lib_link_class) dyn_lib_class : 4;
/* Whether the bfd uses OS specific bits that require ELFOSABI_GNU. */
- ENUM_BITFIELD (elf_gnu_osabi) has_gnu_osabi : 3;
+ ENUM_BITFIELD (elf_gnu_osabi) has_gnu_osabi : 4;
/* Whether if the bfd contains the GNU_PROPERTY_NO_COPY_ON_PROTECTED
property. */
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 **);
+ (bfd *, asection *, asymbol **, bfd_boolean);
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