diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-05-24 20:44:50 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-05-24 20:44:50 +0000 |
commit | 5315c42827694b2d9d25cf99f238de673fbe475c (patch) | |
tree | ae7c88d0caca8b07e70c20bc34d922a9af1ad081 /bfd/libelf.h | |
parent | f49f58c6a8ffdc40d3f11ffe9e5de782ef5e0017 (diff) | |
download | gdb-5315c42827694b2d9d25cf99f238de673fbe475c.zip gdb-5315c42827694b2d9d25cf99f238de673fbe475c.tar.gz gdb-5315c42827694b2d9d25cf99f238de673fbe475c.tar.bz2 |
Make MIPS ELF use new ELF backend linker. No shared library
support yet.
* elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function.
(bfd_mips_elf32_swap_gptab_out): New function.
(mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab.
(mips_elf_final_write_processing): Set sh_info field for .gptab.*
sections.
(mips_elf_fake_sections): Set sh_entsize for .gptab.* sections.
(mips_elf_read_ecoff_info): Read and free external symbols last,
not first, for clarity.
(struct mips_elf_link_hash_entry): Define new structure.
(struct mips_elf_link_hash_table): Define new structure.
(mips_elf_link_hash_lookup): Define new macro.
(mips_elf_link_hash_traverse): Define new macro.
(mips_elf_hash_table): Define new macro.
(mips_elf_link_hash_newfunc): New static function.
(mips_elf_link_hash_table_create): New static function.
(mips_elf_add_symbol_hook): New static function.
(struct extsym_info): Define new structure.
(mips_elf_get_extr, mips_elf_set_index): Remove.
(mips_elf_output_extsym): New static function.
(gptab_compare): New static function.
(mips_elf_final_link): Rewrite to use ELF backend linker, and to
merge gptab information in input files.
(mips_elf_relocate_hi16): New static function.
(mips_elf_relocate_section): New static function.
(bfd_elf32_bfd_link_hash_table_create): Define as macro before
including elf32-target.h.
(elf_backend_relocate_section): Likewise.
(elf_backend_add_symbol_hook): Likewise.
* elf.c (_bfd_elf_link_hash_newfunc): Rename from
elf_link_hash_newfunc and make globally visible. Change caller.
(_bfd_elf_link_hash_table_init): New function, broken out of
_bfd_elf_link_hash_table_create.
(_bfd_elf_link_hash_table_create): Use
_bfd_elf_link_hash_table_init.
* libelf.h (struct elf_obj_tdata): Add new field bad_symtab.
(elf_bad_symtab): Define new accessor macro.
(_bfd_elf_link_hash_newfunc): Declare.
(_bew_elf_link_hash_table_init): Declare.
* elfcode.h (elf_object_p): Call backend object_p hook after
swapping in all the section headers.
(map_program_segments): Correct typo: Internal for External.
(elf_link_add_object_symbols): If elf_bad_symtab is set, read all
the symbols. Skip STB_LOCAL symbols rather than giving an error.
(elf_bfd_final_link): If elf_bad_symtab is set, allocate space for
all symbols, not just locals.
(elf_link_output_extsym): Only skip a symbol not mentioned by a
regular file if it is mentioned by a dynamic object.
(elf_link_input_bfd): If elf_bad_symtab is set, read all the
symbols.
Diffstat (limited to 'bfd/libelf.h')
-rw-r--r-- | bfd/libelf.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bfd/libelf.h b/bfd/libelf.h index 25d56b0..6850aba 100644 --- a/bfd/libelf.h +++ b/bfd/libelf.h @@ -416,6 +416,13 @@ struct elf_obj_tdata table, used when linking. This is indexed by the symbol index minus the sh_info field of the symbol table header. */ struct elf_link_hash_entry **sym_hashes; + + /* 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. */ + boolean bad_symtab; }; #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) @@ -434,6 +441,7 @@ struct elf_obj_tdata #define elf_gp(bfd) (elf_tdata(bfd) -> gp) #define elf_gp_size(bfd) (elf_tdata(bfd) -> gp_size) #define elf_sym_hashes(bfd) (elf_tdata(bfd) -> sym_hashes) +#define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab) extern char * elf_string_from_elf_section PARAMS ((bfd *, unsigned, unsigned)); extern char * elf_get_str_section PARAMS ((bfd *, unsigned)); @@ -455,8 +463,15 @@ extern boolean bfd_elf_mkobject PARAMS ((bfd *)); extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *)); extern boolean _bfd_elf_make_section_from_shdr PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name)); +extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create PARAMS ((bfd *)); +extern boolean _bfd_elf_link_hash_table_init + PARAMS ((struct elf_link_hash_table *, bfd *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *))); extern boolean bfd_elf32_write_object_contents PARAMS ((bfd *)); extern boolean bfd_elf64_write_object_contents PARAMS ((bfd *)); |