struct elf_link_hash_entry *parent;
};
+/* ELF symbol version. */
+enum elf_symbol_version
+ {
+ unknown = 0,
+ unversioned,
+ versioned,
+ versioned_hidden
+ };
+
/* ELF linker hash table entries. */
struct elf_link_hash_entry
unsigned int needs_plt : 1;
/* Symbol appears in a non-ELF input file. */
unsigned int non_elf : 1;
- /* Symbol should be marked as hidden in the version information. */
- unsigned int hidden : 1;
+ /* Symbol version information. */
+ ENUM_BITFIELD (elf_symbol_version) versioned : 2;
/* Symbol was forced to local scope due to a version script file. */
unsigned int forced_local : 1;
/* Symbol was forced to be dynamic due to a version script file. */
GENERIC_ELF_DATA
};
+struct elf_sym_strtab
+{
+ Elf_Internal_Sym sym;
+ unsigned long dest_index;
+ unsigned long destshndx_index;
+};
+
/* ELF linker hash table. */
struct elf_link_hash_table
section. */
struct elf_strtab_hash *dynstr;
+ /* The number of symbol strings found in the link which must be put
+ into the .strtab section. */
+ bfd_size_type strtabcount;
+
+ /* The array size of the symbol string table, which becomes the
+ .strtab section. */
+ bfd_size_type strtabsize;
+
+ /* The array of strings, which becomes the .strtab section. */
+ struct elf_sym_strtab *strtab;
+
/* The number of buckets in the hash table in the .hash section.
This is based on the number of dynamic symbols. */
bfd_size_type bucketcount;
asection *iplt;
asection *irelplt;
asection *irelifunc;
+ asection *dynsym;
};
/* Look up an entry in an ELF linker hash table. */
typedef struct obj_attribute_list
{
struct obj_attribute_list *next;
- int tag;
+ unsigned int tag;
obj_attribute attr;
} obj_attribute_list;
bfd_byte data[1];
};
-/* NT_GNU_BUILD_ID note type info for input BFDs. */
-struct elf_build_id
-{
- size_t size;
- bfd_byte data[1];
-};
-
/* tdata information grabbed from an elf core file. */
struct core_elf_obj_tdata
{
bfd_boolean flags_init;
};
+/* Indicate if the bfd contains 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_symbols
+ {
+ elf_gnu_symbol_none = 0,
+ elf_gnu_symbol_any = 1 << 0,
+ elf_gnu_symbol_ifunc = (elf_gnu_symbol_any | 1 << 1),
+ elf_gnu_symbol_unique = (elf_gnu_symbol_any | 1 << 2),
+ elf_gnu_symbol_all = (elf_gnu_symbol_ifunc | elf_gnu_symbol_unique)
+ };
+
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
obj_attribute_list *other_obj_attributes[2];
- /* NT_GNU_BUILD_ID note type. */
- struct elf_build_id *build_id;
-
/* Linked-list containing information about every Systemtap section
found in the object file. Each section corresponds to one entry
in the list. */
symbols. */
bfd_boolean bad_symtab;
- /* True if the bfd contains 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. */
- bfd_boolean has_gnu_symbols;
+ enum elf_gnu_symbols has_gnu_symbols;
/* Information grabbed from an elf core file. */
struct core_elf_obj_tdata *core;
(struct sym_cache *, bfd *, unsigned long);
extern asection *bfd_section_from_elf_index
(bfd *, unsigned int);
-extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
- (void);
extern struct elf_strtab_hash * _bfd_elf_strtab_init
(void);
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma);
-extern int bfd_elf_get_obj_attr_int (bfd *, int, int);
-extern void bfd_elf_add_obj_attr_int (bfd *, int, int, unsigned int);
+extern int bfd_elf_get_obj_attr_int (bfd *, int, unsigned int);
+extern void bfd_elf_add_obj_attr_int (bfd *, int, unsigned int, unsigned int);
#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \
bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
-extern void bfd_elf_add_obj_attr_string (bfd *, int, int, const char *);
+extern void bfd_elf_add_obj_attr_string (bfd *, int, unsigned int, const char *);
#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \
bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
-extern void bfd_elf_add_obj_attr_int_string (bfd *, int, int, unsigned int,
- const char *);
+extern void bfd_elf_add_obj_attr_int_string (bfd *, int, unsigned int,
+ unsigned int, const char *);
#define bfd_elf_add_proc_attr_int_string(BFD, TAG, INTVAL, STRVAL) \
bfd_elf_add_obj_attr_int_string ((BFD), OBJ_ATTR_PROC, (TAG), \
(INTVAL), (STRVAL))
extern char *_bfd_elf_attr_strdup (bfd *, const char *);
extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *);
-extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, int);
+extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, unsigned int);
extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *);
extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *);
extern bfd_boolean _bfd_elf_merge_unknown_attribute_low (bfd *, bfd *, int);
else if (info->unresolved_syms_in_objects == RM_IGNORE \
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \
ignored = TRUE; \
- else if (!info->relocatable) \
+ else if (!bfd_link_relocatable (info)) \
{ \
bfd_boolean err; \
err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \
_bfd_clear_contents (howto, input_bfd, input_section, \
contents + rel[index].r_offset); \
\
- if (info->relocatable \
+ if (bfd_link_relocatable (info) \
&& (input_section->flags & SEC_DEBUGGING)) \
{ \
/* Only remove relocations in debug sections since other \