aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-05-29 20:33:00 +0000
committerIan Lance Taylor <ian@airs.com>1996-05-29 20:33:00 +0000
commitd1bf45aa9433f77547b091015145da0109f17917 (patch)
tree1b18557063e3f660308f0daa92034e8d371f8b5e /bfd/elf-bfd.h
parent90557a6aea39b0adf094187561fe50579701dd85 (diff)
downloadgdb-d1bf45aa9433f77547b091015145da0109f17917.zip
gdb-d1bf45aa9433f77547b091015145da0109f17917.tar.gz
gdb-d1bf45aa9433f77547b091015145da0109f17917.tar.bz2
64-bit MIPS ELF ABI objdump support:
* elf64-mips.c: New file. * Makefile.in: Rebuild dependencies. (BFD64_BACKENDS): Add elf64-mips.o. (BFD64_BACKENDS_CFILES): Add elf64-mips.c. * config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to targ_selvecs. (mips*-*-elf*): Likewise. * confingure.in: Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to vector switch. * configure: Rebuild. * elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function, broken out of mips_elf_section_from_shdr. (mips_elf32_section_from_shdr): Rename from mips_elf_section_from_shdr. Call new function. (elf_backend_section_from_shdr): Update name of renamed function. * elf-bfd.h (struct elf_size_info): Change second parameter of write_out_phdrs to be const. Likewise for second parameter of swap_symbol_out. (struct bfd_elf_section_data): Add rel_hdr2 field. (bfd_elf32_swap_symbol_in): Change second parameter to be const. (bfd_elf32_swap_symbol_out): Likewise. (bfd_elf32_swap_reloc_in): Likewise. (bfd_elf32_swap_reloc_out): Likewise. (bfd_elf32_swap_reloca_in): Likewise. (bfd_elf32_swap_reloca_out): Likewise. (bfd_elf32_swap_phdr_in): Likewise. (bfd_elf32_swap_phdr_out): Likewise. (bfd_elf32_swap_dyn_in): Likewise. (bfd_elf32_swap_dyn_out): Likewise. (bfd_elf32_slurp_symbol_table): Declare. (bfd_elf32_write_shdrs_and_ehdr): Declare. (bfd_elf32_write_out_phdrs): Declare. (bfd_elf64_swap_symbol_in): Change second parameter to be const. (bfd_elf64_swap_symbol_out): Likewise. (bfd_elf64_swap_reloc_in): Likewise. (bfd_elf64_swap_reloc_out): Likewise. (bfd_elf64_swap_reloca_in): Likewise. (bfd_elf64_swap_reloca_out): Likewise. (bfd_elf64_swap_phdr_in): Likewise. (bfd_elf64_swap_phdr_out): Likewise. (bfd_elf64_swap_dyn_in): Likewise. (bfd_elf64_swap_dyn_out): Likewise. (bfd_elf64_slurp_symbol_table): Declare. (bfd_elf64_write_shdrs_and_ehdr): Declare. (bfd_elf64_write_out_phdrs): Declare. (_bfd_mips_elf_section_from_shdr): Declare. * elf.c (bfd_section_from_shdr): Remove assertion requiring SHT_REL/SHT_RELA to match use_rela_p. If there is already a reloc section for the section, add the new one to rel_hdr2. Increment reloc_count rather than setting it. * elfcode.h (elf_slurp_symbol_table): Define name as macro. Remove static declaration. (elf_write_shdrs_and_ehdr): Define name as macro. (elf_write_out_phdrs): Likewise. (elf_swap_ehdr_in, elf_swap_ehdr_out): Declare. (elf_swap_shdr_in, elf_swap_shdr_out): Declare. (elf_swap_symbol_in): Change second parameter to be const. (elf_swap_symbol_out): Likewise. (elf_swap_ehdr_in, elf_swap_ehdr_out): Likewise. (elf_swap_shdr_in, elf_swap_shdr_out): Likewise. (elf_swap_phdr_in, elf_swap_phdr_out): Likewise. (elf_swap_reloc_in, elf_swap_reloc_out): Likewise. (elf_swap_reloca_in, elf_swap_reloca_out): Likewise. (elf_write_out_phdrs): Rename from write_out_phdrs. Change second parameter to be const. Make non-static. (elf_write_shdrs_and_ehdr): Rename from write_shdrs_and_ehdr. Make non-static. (elf_slurp_symbol_table): Make non-static. (NAME(_bfd_elf,size_info)): Update names of renamed functions. * elfxx-target.h (elf_info_to_howto): Define if not defined. (elf_backend_size_info): Likewise. (elfNN_bed): Use elf_backend_size_info. * targets.c (bfd_elf64_bigmips_vec): Declare. (bfd_elf64_littlemips_vec): Declare. (bfd_target_vector): Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec if BFD64 is defined.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h58
1 files changed, 40 insertions, 18 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 987425e..7b9b243 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -158,6 +158,8 @@ struct elf_link_hash_table
struct bfd_link_needed_list *needed;
/* The _GLOBAL_OFFSET_TABLE_ symbol. */
struct elf_link_hash_entry *hgot;
+ /* A pointer to information used to link stabs in sections. */
+ PTR stab_info;
};
/* Look up an entry in an ELF linker hash table. */
@@ -187,10 +189,10 @@ struct elf_size_info {
unsigned char arch_size, file_align;
unsigned char elfclass, ev_current;
- int (*write_out_phdrs) PARAMS ((bfd *, Elf_Internal_Phdr *, int));
+ int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
boolean (*write_shdrs_and_ehdr) PARAMS ((bfd *));
void (*write_relocs) PARAMS ((bfd *, asection *, PTR));
- void (*swap_symbol_out) PARAMS ((bfd *, Elf_Internal_Sym *, PTR));
+ void (*swap_symbol_out) PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
boolean (*slurp_reloc_table) PARAMS ((bfd *, asection *, asymbol **));
long (*slurp_symbol_table) PARAMS ((bfd *, asymbol **, boolean));
void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
@@ -464,6 +466,9 @@ struct bfd_elf_section_data
/* The ELF header for the reloc section associated with this
section, if any. */
Elf_Internal_Shdr rel_hdr;
+ /* If there is a second reloc section associated with this section,
+ as can happen on Irix 6, this field points to the header. */
+ Elf_Internal_Shdr *rel_hdr2;
/* The ELF section number of this section. Only used for an output
file. */
int this_idx;
@@ -481,6 +486,8 @@ struct bfd_elf_section_data
record the dynamic symbol index for a section symbol
corresponding to this section. */
long dynindx;
+ /* A pointer used for .stab linking optimizations. */
+ PTR stab_info;
/* A pointer available for the processor specific ELF backend. */
PTR tdata;
};
@@ -794,25 +801,30 @@ extern boolean bfd_elf32_bfd_final_link
PARAMS ((bfd *, struct bfd_link_info *));
extern void bfd_elf32_swap_symbol_in
- PARAMS ((bfd *, Elf32_External_Sym *, Elf_Internal_Sym *));
+ PARAMS ((bfd *, const Elf32_External_Sym *, Elf_Internal_Sym *));
extern void bfd_elf32_swap_symbol_out
- PARAMS ((bfd *, Elf_Internal_Sym *, PTR));
+ PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
extern void bfd_elf32_swap_reloc_in
- PARAMS ((bfd *, Elf32_External_Rel *, Elf_Internal_Rel *));
+ PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel *));
extern void bfd_elf32_swap_reloc_out
- PARAMS ((bfd *, Elf_Internal_Rel *, Elf32_External_Rel *));
+ PARAMS ((bfd *, const Elf_Internal_Rel *, Elf32_External_Rel *));
extern void bfd_elf32_swap_reloca_in
- PARAMS ((bfd *, Elf32_External_Rela *, Elf_Internal_Rela *));
+ PARAMS ((bfd *, const Elf32_External_Rela *, Elf_Internal_Rela *));
extern void bfd_elf32_swap_reloca_out
- PARAMS ((bfd *, Elf_Internal_Rela *, Elf32_External_Rela *));
+ PARAMS ((bfd *, const Elf_Internal_Rela *, Elf32_External_Rela *));
extern void bfd_elf32_swap_phdr_in
- PARAMS ((bfd *, Elf32_External_Phdr *, Elf_Internal_Phdr *));
+ PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *));
extern void bfd_elf32_swap_phdr_out
- PARAMS ((bfd *, Elf_Internal_Phdr *, Elf32_External_Phdr *));
+ PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *));
extern void bfd_elf32_swap_dyn_in
PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
extern void bfd_elf32_swap_dyn_out
PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf32_External_Dyn *));
+extern long bfd_elf32_slurp_symbol_table
+ PARAMS ((bfd *, asymbol **, boolean));
+extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *));
+extern int bfd_elf32_write_out_phdrs
+ PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
extern boolean bfd_elf32_add_dynamic_entry
PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
extern boolean bfd_elf32_link_create_dynamic_sections
@@ -830,25 +842,30 @@ extern boolean bfd_elf64_bfd_final_link
PARAMS ((bfd *, struct bfd_link_info *));
extern void bfd_elf64_swap_symbol_in
- PARAMS ((bfd *, Elf64_External_Sym *, Elf_Internal_Sym *));
+ PARAMS ((bfd *, const Elf64_External_Sym *, Elf_Internal_Sym *));
extern void bfd_elf64_swap_symbol_out
- PARAMS ((bfd *, Elf_Internal_Sym *, PTR));
+ PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
extern void bfd_elf64_swap_reloc_in
- PARAMS ((bfd *, Elf64_External_Rel *, Elf_Internal_Rel *));
+ PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel *));
extern void bfd_elf64_swap_reloc_out
- PARAMS ((bfd *, Elf_Internal_Rel *, Elf64_External_Rel *));
+ PARAMS ((bfd *, const Elf_Internal_Rel *, Elf64_External_Rel *));
extern void bfd_elf64_swap_reloca_in
- PARAMS ((bfd *, Elf64_External_Rela *, Elf_Internal_Rela *));
+ PARAMS ((bfd *, const Elf64_External_Rela *, Elf_Internal_Rela *));
extern void bfd_elf64_swap_reloca_out
- PARAMS ((bfd *, Elf_Internal_Rela *, Elf64_External_Rela *));
+ PARAMS ((bfd *, const Elf_Internal_Rela *, Elf64_External_Rela *));
extern void bfd_elf64_swap_phdr_in
- PARAMS ((bfd *, Elf64_External_Phdr *, Elf_Internal_Phdr *));
+ PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *));
extern void bfd_elf64_swap_phdr_out
- PARAMS ((bfd *, Elf_Internal_Phdr *, Elf64_External_Phdr *));
+ PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *));
extern void bfd_elf64_swap_dyn_in
PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
extern void bfd_elf64_swap_dyn_out
PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf64_External_Dyn *));
+extern long bfd_elf64_slurp_symbol_table
+ PARAMS ((bfd *, asymbol **, boolean));
+extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *));
+extern int bfd_elf64_write_out_phdrs
+ PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
extern boolean bfd_elf64_add_dynamic_entry
PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
extern boolean bfd_elf64_link_create_dynamic_sections
@@ -857,4 +874,9 @@ extern boolean bfd_elf64_link_create_dynamic_sections
#define bfd_elf32_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
#define bfd_elf64_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
+/* MIPS ELF specific routines. */
+
+extern boolean _bfd_mips_elf_section_from_shdr
+ PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
+
#endif /* _LIBELF_H_ */