X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=bfd%2Fbfd-in2.h;h=072812e4f14b3c1efc2d052c39bd7021b4f5ae4a;hb=e6300d0dc65b17a4cc45fe044825885976eea5b9;hp=25f2f96c7187d71e88790d4d1797cd59a55d32e5;hpb=52b69c9e01afa3fffa5f9e83d7e560f47610d651;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 25f2f96c71..072812e4f1 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6,9 +6,10 @@ Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -75,7 +76,7 @@ extern "C" { #endif /* Forward declaration. */ -typedef struct _bfd bfd; +typedef struct bfd bfd; /* Boolean type used in bfd. Too many systems define their own versions of "boolean" for us to safely typedef a "boolean" of @@ -657,9 +658,7 @@ struct bfd_link_needed_list const char *name; }; -extern bfd_boolean bfd_elf32_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); -extern bfd_boolean bfd_elf64_record_link_assignment +extern bfd_boolean bfd_elf_record_link_assignment PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); extern struct bfd_link_needed_list *bfd_elf_get_needed_list PARAMS ((bfd *, struct bfd_link_info *)); @@ -702,6 +701,22 @@ extern long bfd_get_elf_phdr_upper_bound extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len))); + /* Return the arch_size field of an elf bfd, or -1 if not elf. */ extern int bfd_get_arch_size PARAMS ((bfd *)); @@ -841,6 +856,16 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd PARAMS ((bfd *, struct bfd_link_info *)); +/* ARM Note section processing. */ +extern bfd_boolean bfd_arm_merge_machines + PARAMS ((bfd *, bfd *)); + +extern bfd_boolean bfd_arm_update_notes + PARAMS ((bfd *, const char *)); + +extern unsigned int bfd_arm_get_mach_from_notes + PARAMS ((bfd *, const char *)); + /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page PARAMS ((struct sec *, int)); @@ -880,6 +905,15 @@ bfd_make_writable PARAMS ((bfd *abfd)); bfd_boolean bfd_make_readable PARAMS ((bfd *abfd)); +unsigned long +bfd_calc_gnu_debuglink_crc32 PARAMS ((unsigned long crc, const unsigned char *buf, bfd_size_type len)); + +char * +bfd_follow_gnu_debuglink PARAMS ((bfd *abfd, const char *dir)); + +bfd_boolean +bfd_add_gnu_debuglink PARAMS ((bfd * abfd, const char * filename)); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1258,10 +1292,39 @@ typedef struct sec /* A mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; - /* Used by the ELF code to mark sections which have been allocated - to segments. */ + /* The following flags are used by the ELF linker. */ + + /* Mark sections which have been allocated to segments. */ unsigned int segment_mark : 1; + /* Type of sec_info information. */ + unsigned int sec_info_type:3; +#define ELF_INFO_TYPE_NONE 0 +#define ELF_INFO_TYPE_STABS 1 +#define ELF_INFO_TYPE_MERGE 2 +#define ELF_INFO_TYPE_EH_FRAME 3 +#define ELF_INFO_TYPE_JUST_SYMS 4 + + /* Nonzero if this section uses RELA relocations, rather than REL. */ + unsigned int use_rela_p:1; + + /* Bits used by various backends. */ + unsigned int has_tls_reloc:1; + + /* Nonzero if this section needs the relax finalize pass. */ + unsigned int need_finalize_relax:1; + + /* Nonzero if this section has a gp reloc. */ + unsigned int has_gp_reloc:1; + + /* Usused bits. */ + unsigned int flag13:1; + unsigned int flag14:1; + unsigned int flag15:1; + unsigned int flag16:4; + unsigned int flag20:4; + unsigned int flag24:8; + /* End of internal packed boolean fields. */ /* The virtual memory address of the section - where it will be @@ -1590,10 +1653,14 @@ enum bfd_architecture bfd_arch_m88k, /* Motorola 88xxx */ bfd_arch_m98k, /* Motorola 98xxx */ bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Hitachi H8/300 */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 bfd_arch_pdp11, /* DEC PDP-11 */ bfd_arch_powerpc, /* PowerPC */ #define bfd_mach_ppc 32 @@ -1635,8 +1702,8 @@ enum bfd_architecture bfd_arch_z8k, /* Zilog Z8000 */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Hitachi H8/500 */ - bfd_arch_sh, /* Hitachi SH */ + bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ #define bfd_mach_sh 1 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d @@ -1651,6 +1718,7 @@ enum bfd_architecture #define bfd_mach_alpha_ev5 0x20 #define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ +#define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -1661,12 +1729,14 @@ enum bfd_architecture #define bfd_mach_arm_5T 8 #define bfd_mach_arm_5TE 9 #define bfd_mach_arm_XScale 10 +#define bfd_mach_arm_ep9312 11 +#define bfd_mach_arm_iWMMXt 12 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ -#define bfd_mach_c3x 30 -#define bfd_mach_c4x 40 +#define bfd_mach_tic3x 30 +#define bfd_mach_tic4x 40 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ bfd_arch_tic80, /* TI TMS320c80 (MVP) */ bfd_arch_v850, /* NEC V850 */ @@ -1677,7 +1747,7 @@ enum bfd_architecture #define bfd_mach_arc_6 6 #define bfd_mach_arc_7 7 #define bfd_mach_arc_8 8 - bfd_arch_m32r, /* Mitsubishi M32R/D */ + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' bfd_arch_mn10200, /* Matsushita MN10200 */ @@ -1732,6 +1802,8 @@ enum bfd_architecture #define bfd_mach_msp44 44 #define bfd_mach_msp15 15 #define bfd_mach_msp16 16 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ +#define bfd_mach_xtensa 1 bfd_arch_last }; @@ -2460,6 +2532,48 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, +/* PowerPC and PowerPC64 thread-local storage relocations. */ + BFD_RELOC_PPC_TLS, + BFD_RELOC_PPC_DTPMOD, + BFD_RELOC_PPC_TPREL16, + BFD_RELOC_PPC_TPREL16_LO, + BFD_RELOC_PPC_TPREL16_HI, + BFD_RELOC_PPC_TPREL16_HA, + BFD_RELOC_PPC_TPREL, + BFD_RELOC_PPC_DTPREL16, + BFD_RELOC_PPC_DTPREL16_LO, + BFD_RELOC_PPC_DTPREL16_HI, + BFD_RELOC_PPC_DTPREL16_HA, + BFD_RELOC_PPC_DTPREL, + BFD_RELOC_PPC_GOT_TLSGD16, + BFD_RELOC_PPC_GOT_TLSGD16_LO, + BFD_RELOC_PPC_GOT_TLSGD16_HI, + BFD_RELOC_PPC_GOT_TLSGD16_HA, + BFD_RELOC_PPC_GOT_TLSLD16, + BFD_RELOC_PPC_GOT_TLSLD16_LO, + BFD_RELOC_PPC_GOT_TLSLD16_HI, + BFD_RELOC_PPC_GOT_TLSLD16_HA, + BFD_RELOC_PPC_GOT_TPREL16, + BFD_RELOC_PPC_GOT_TPREL16_LO, + BFD_RELOC_PPC_GOT_TPREL16_HI, + BFD_RELOC_PPC_GOT_TPREL16_HA, + BFD_RELOC_PPC_GOT_DTPREL16, + BFD_RELOC_PPC_GOT_DTPREL16_LO, + BFD_RELOC_PPC_GOT_DTPREL16_HI, + BFD_RELOC_PPC_GOT_DTPREL16_HA, + BFD_RELOC_PPC64_TPREL16_DS, + BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGHER, + BFD_RELOC_PPC64_TPREL16_HIGHERA, + BFD_RELOC_PPC64_TPREL16_HIGHEST, + BFD_RELOC_PPC64_TPREL16_HIGHESTA, + BFD_RELOC_PPC64_DTPREL16_DS, + BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGHER, + BFD_RELOC_PPC64_DTPREL16_HIGHERA, + BFD_RELOC_PPC64_DTPREL16_HIGHEST, + BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -2491,6 +2605,7 @@ field in the instruction. */ BFD_RELOC_ARM_SWI, BFD_RELOC_ARM_MULTI, BFD_RELOC_ARM_CP_OFF_IMM, + BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -2511,7 +2626,7 @@ field in the instruction. */ BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC, -/* Hitachi SH relocs. Not all of these appear in object files. */ +/* Renesas / SuperH SH relocs. Not all of these appear in object files. */ BFD_RELOC_SH_PCDISP8BY2, BFD_RELOC_SH_PCDISP12BY2, BFD_RELOC_SH_IMM4, @@ -2689,7 +2804,7 @@ of the container. */ /* DLX relocs */ BFD_RELOC_DLX_JMP26, -/* Mitsubishi M32R relocs. +/* Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit absolute address. */ BFD_RELOC_M32R_24, @@ -3352,6 +3467,38 @@ to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21, BFD_RELOC_IQ2000_UHI16, + +/* Special Xtensa relocation used only by PLT entries in ELF shared +objects to indicate that the runtime linker should set the value +to one of its own internal functions or data structures. */ + BFD_RELOC_XTENSA_RTLD, + +/* Xtensa relocations for ELF shared objects. */ + BFD_RELOC_XTENSA_GLOB_DAT, + BFD_RELOC_XTENSA_JMP_SLOT, + BFD_RELOC_XTENSA_RELATIVE, + +/* Xtensa relocation used in ELF object files for symbols that may require +PLT entries. Otherwise, this is just a generic 32-bit relocation. */ + BFD_RELOC_XTENSA_PLT, + +/* Generic Xtensa relocations. Only the operand number is encoded +in the relocation. The details are determined by extracting the +instruction opcode. */ + BFD_RELOC_XTENSA_OP0, + BFD_RELOC_XTENSA_OP1, + BFD_RELOC_XTENSA_OP2, + +/* Xtensa relocation to mark that the assembler expanded the +instructions from an original target. The expansion size is +encoded in the reloc size. */ + BFD_RELOC_XTENSA_ASM_EXPAND, + +/* Xtensa relocation to mark that the linker should simplify +assembler-expanded instructions. This is commonly used +internally by the linker after analysis of a +BFD_RELOC_XTENSA_ASM_EXPAND. */ + BFD_RELOC_XTENSA_ASM_SIMPLIFY, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type * @@ -3373,7 +3520,7 @@ typedef struct symbol_cache_entry instead, except that some symbols point to the global sections bfd_{abs,com,und}_section. This could be fixed by making these globals be per-bfd (or per-target-flavor). FIXME. */ - struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ /* The text of the symbol. The name is left alone, and not copied; the application may not alter it. */ @@ -3534,7 +3681,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ -struct _bfd +struct bfd { /* A unique identifier of the BFD */ unsigned int id; @@ -3565,7 +3712,7 @@ struct _bfd /* The caching routines use these to maintain a least-recently-used list of BFDs. */ - struct _bfd *lru_prev, *lru_next; + struct bfd *lru_prev, *lru_next; /* When a file is closed by the caching routines, BFD retains state information on the file here... */ @@ -3639,13 +3786,13 @@ struct _bfd /* Stuff only useful for archives. */ PTR arelt_data; - struct _bfd *my_archive; /* The containing archive BFD. */ - struct _bfd *next; /* The next BFD in the archive. */ - struct _bfd *archive_head; /* The first BFD in the archive. */ + struct bfd *my_archive; /* The containing archive BFD. */ + struct bfd *next; /* The next BFD in the archive. */ + struct bfd *archive_head; /* The first BFD in the archive. */ bfd_boolean has_armap; /* A chain of BFD structures involved in a link. */ - struct _bfd *link_next; + struct bfd *link_next; /* A field used by _bfd_generic_link_add_archive_symbols. This will be used only for archive elements. */ @@ -3801,33 +3948,31 @@ bfd_boolean bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, \ - (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) + BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) #define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) + BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) #define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) #define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) #define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) #define bfd_relax_section(abfd, section, link_info, again) \ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) @@ -4286,14 +4431,17 @@ const char ** bfd_target_list PARAMS ((void)); const bfd_target * -bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); +bfd_search_for_target PARAMS ((int (* search_func) + (const bfd_target *, void *), + void *)); /* Extracted from format.c. */ bfd_boolean bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); bfd_boolean -bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); +bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, + char ***matching)); bfd_boolean bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); @@ -4310,7 +4458,7 @@ bfd_link_split_section PARAMS ((bfd *abfd, asection *sec)); /* Extracted from simple.c. */ bfd_byte * -bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf)); +bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table)); #ifdef __cplusplus }