bfd_byte data[1];
};
-/* NT_GNU_BUILD_ID note type info. */
-struct elf_build_id_info
+/* NT_GNU_BUILD_ID note type info for input BFDs. */
+struct elf_build_id
{
- union
- {
- /* Used on output bfd by linker. */
- struct elf_build_id_out
- {
- size_t zero; /* Always zero */
- bfd_boolean (*after_write_object_contents) (bfd *);
- const char *style;
- asection *sec;
- } o;
- /* Used for input bfd. */
- struct elf_build_id
- {
- size_t size; /* Always non-zero */
- bfd_byte data[1];
- } i;
- } u;
+ size_t size;
+ bfd_byte data[1];
};
/* tdata information grabbed from an elf core file. */
char* command;
};
+/* Extra tdata information held for output ELF BFDs. */
+struct output_elf_obj_tdata
+{
+ struct elf_segment_map *seg_map;
+ struct elf_strtab_hash *strtab_ptr;
+
+ /* STT_SECTION symbols for each section */
+ asymbol **section_syms;
+
+ /* Used to determine if PT_GNU_EH_FRAME segment header should be
+ created. */
+ asection *eh_frame_hdr;
+
+ /* NT_GNU_BUILD_ID note type info. */
+ struct
+ {
+ bfd_boolean (*after_write_object_contents) (bfd *);
+ const char *style;
+ asection *sec;
+ } build_id;
+
+ /* Records the result of `get_program_header_size'. */
+ bfd_size_type program_header_size;
+
+ /* Used when laying out sections. */
+ file_ptr next_file_pos;
+
+ int num_section_syms;
+ unsigned int shstrtab_section, strtab_section;
+
+ /* Segment flags for the PT_GNU_STACK segment. */
+ unsigned int stack_flags;
+
+ /* This is set to TRUE if the object was created by the backend
+ linker. */
+ bfd_boolean linker;
+
+ /* Used to determine if the e_flags field has been initialized */
+ bfd_boolean flags_init;
+};
+
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
Elf_Internal_Ehdr elf_header[1]; /* Actual data, but ref like ptr */
Elf_Internal_Shdr **elf_sect_ptr;
Elf_Internal_Phdr *phdr;
- struct elf_segment_map *seg_map;
- struct elf_strtab_hash *strtab_ptr;
- unsigned int num_elf_sections; /* elf_sect_ptr size */
- int num_section_syms;
- asymbol **section_syms; /* STT_SECTION symbols for each section */
Elf_Internal_Shdr symtab_hdr;
Elf_Internal_Shdr shstrtab_hdr;
Elf_Internal_Shdr strtab_hdr;
Elf_Internal_Shdr dynverref_hdr;
Elf_Internal_Shdr dynverdef_hdr;
Elf_Internal_Shdr symtab_shndx_hdr;
- unsigned int symtab_section, shstrtab_section;
- unsigned int strtab_section, dynsymtab_section;
- unsigned int symtab_shndx_section;
- unsigned int dynversym_section, dynverdef_section, dynverref_section;
- file_ptr next_file_pos;
bfd_vma gp; /* The gp value */
unsigned int gp_size; /* The gp size */
+ unsigned int num_elf_sections; /* elf_sect_ptr size */
/* A mapping from external symbols to entries in the linker hash
table, used when linking. This is indexed by the symbol index
are used by a dynamic object. */
const char *dt_audit;
- /* Records the result of `get_program_header_size'. */
- bfd_size_type program_header_size;
-
/* Used by find_nearest_line entry point. */
void *line_info;
/* Stash away info for yet another find line/function variant. */
void *elf_find_function_cache;
- /* Used to determine if PT_GNU_EH_FRAME segment header should be
- created. */
- asection *eh_frame_hdr;
-
- Elf_Internal_Shdr **group_sect_ptr;
- int num_group;
-
/* Number of symbol version definitions we are about to emit. */
unsigned int cverdefs;
/* Number of symbol version references we are about to emit. */
unsigned int cverrefs;
- /* Segment flags for the PT_GNU_STACK segment. */
- unsigned int stack_flags;
-
/* Symbol version definitions in external objects. */
Elf_Internal_Verdef *verdef;
/* A pointer to the .eh_frame section. */
asection *eh_frame_section;
- /* Whether a dyanmic object was specified normally on the linker
- command line, or was specified when --as-needed was in effect,
- or was found via a DT_NEEDED entry. */
- enum dynamic_lib_link_class dyn_lib_class;
-
- /* This is set to TRUE if the object was created by the backend
- linker. */
- bfd_boolean linker;
-
- /* Irix 5 often screws up the symbol table, sorting local symbols
- after global symbols. This flag is set if the symbol table in
- this BFD appears to be screwed up. If it is, we ignore the
- sh_info field in the symbol table header, and always read all the
- symbols. */
- bfd_boolean bad_symtab;
-
- /* Used to determine if the e_flags field has been initialized */
- bfd_boolean flags_init;
-
/* Symbol buffer. */
void *symbuf;
obj_attribute_list *other_obj_attributes[2];
/* NT_GNU_BUILD_ID note type. */
- struct elf_build_id_info *build_id;
+ 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. */
struct sdt_note *sdt_note_head;
- /* 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;
+ Elf_Internal_Shdr **group_sect_ptr;
+ int num_group;
+
+ unsigned int symtab_section, symtab_shndx_section, dynsymtab_section;
+ unsigned int dynversym_section, dynverdef_section, dynverref_section;
/* An identifier used to distinguish different target
specific extensions to this structure. */
enum elf_target_id object_id;
+ /* Whether a dyanmic object was specified normally on the linker
+ command line, or was specified when --as-needed was in effect,
+ or was found via a DT_NEEDED entry. */
+ enum dynamic_lib_link_class dyn_lib_class;
+
+ /* Irix 5 often screws up the symbol table, sorting local symbols
+ after global symbols. This flag is set if the symbol table in
+ this BFD appears to be screwed up. If it is, we ignore the
+ sh_info field in the symbol table header, and always read all the
+ 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;
+
/* Information grabbed from an elf core file. */
struct core_elf_obj_tdata *core;
+
+ /* More information held for output ELF BFDs. */
+ struct output_elf_obj_tdata *o;
};
#define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
#define elf_object_id(bfd) (elf_tdata(bfd) -> object_id)
-#define elf_program_header_size(bfd) (elf_tdata(bfd) -> program_header_size)
+#define elf_program_header_size(bfd) (elf_tdata(bfd) -> o->program_header_size)
#define elf_elfheader(bfd) (elf_tdata(bfd) -> elf_header)
#define elf_elfsections(bfd) (elf_tdata(bfd) -> elf_sect_ptr)
#define elf_numsections(bfd) (elf_tdata(bfd) -> num_elf_sections)
-#define elf_seg_map(bfd) (elf_tdata(bfd) -> seg_map)
-#define elf_next_file_pos(bfd) (elf_tdata(bfd) -> next_file_pos)
-#define elf_eh_frame_hdr(bfd) (elf_tdata(bfd) -> eh_frame_hdr)
-#define elf_linker(bfd) (elf_tdata(bfd) -> linker)
-#define elf_stack_flags(bfd) (elf_tdata(bfd) -> stack_flags)
-#define elf_shstrtab(bfd) (elf_tdata(bfd) -> strtab_ptr)
+#define elf_seg_map(bfd) (elf_tdata(bfd) -> o->seg_map)
+#define elf_next_file_pos(bfd) (elf_tdata(bfd) -> o->next_file_pos)
+#define elf_eh_frame_hdr(bfd) (elf_tdata(bfd) -> o->eh_frame_hdr)
+#define elf_linker(bfd) (elf_tdata(bfd) -> o->linker)
+#define elf_stack_flags(bfd) (elf_tdata(bfd) -> o->stack_flags)
+#define elf_shstrtab(bfd) (elf_tdata(bfd) -> o->strtab_ptr)
#define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section)
#define elf_symtab_shndx(bfd) (elf_tdata(bfd) -> symtab_shndx_section)
-#define elf_strtab_sec(bfd) (elf_tdata(bfd) -> strtab_section)
-#define elf_shstrtab_sec(bfd) (elf_tdata(bfd) -> shstrtab_section)
+#define elf_strtab_sec(bfd) (elf_tdata(bfd) -> o->strtab_section)
+#define elf_shstrtab_sec(bfd) (elf_tdata(bfd) -> o->shstrtab_section)
#define elf_symtab_hdr(bfd) (elf_tdata(bfd) -> symtab_hdr)
#define elf_dynsymtab(bfd) (elf_tdata(bfd) -> dynsymtab_section)
#define elf_dynversym(bfd) (elf_tdata(bfd) -> dynversym_section)
#define elf_dynverref(bfd) (elf_tdata(bfd) -> dynverref_section)
#define elf_eh_frame_section(bfd) \
(elf_tdata(bfd) -> eh_frame_section)
-#define elf_section_syms(bfd) (elf_tdata(bfd) -> section_syms)
-#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> num_section_syms)
+#define elf_section_syms(bfd) (elf_tdata(bfd) -> o->section_syms)
+#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> o->num_section_syms)
#define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo)
#define core_prstatus(bfd) (elf_tdata(bfd) -> prstatus)
#define elf_gp(bfd) (elf_tdata(bfd) -> gp)
#define elf_dt_audit(bfd) (elf_tdata(bfd) -> dt_audit)
#define elf_dyn_lib_class(bfd) (elf_tdata(bfd) -> dyn_lib_class)
#define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
-#define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init)
+#define elf_flags_init(bfd) (elf_tdata(bfd) -> o->flags_init)
#define elf_known_obj_attributes(bfd) (elf_tdata (bfd) -> known_obj_attributes)
#define elf_other_obj_attributes(bfd) (elf_tdata (bfd) -> other_obj_attributes)
#define elf_known_obj_attributes_proc(bfd) \