X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fbfd-in2.h;h=408ca587ff6f657299960ec011e04d3f33e2de3a;hb=0822b56d6697291674d9b15a2ca22f58c8deb2df;hp=39bda1e071a02e938e07859b3d6dbb106ddb8f12;hpb=7c726b6625a0310e63a2b046dc3b4a3162f1ecc1;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 39bda1e071..408ca587ff 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -99,15 +99,16 @@ typedef enum bfd_boolean {bfd_false, bfd_true} boolean; /* typedef off_t file_ptr; */ typedef long int file_ptr; -/* Support for different sizes of target format ints and addresses. If the - host implements 64-bit values, it defines BFD_HOST_64_BIT to be the appropriate - type. Otherwise, this code will fall back on gcc's "long long" type if gcc - is being used. BFD_HOST_64_BIT must be defined in such a way as to be a valid - type name by itself or with "unsigned" prefixed. It should be a signed - type by itself. +/* Support for different sizes of target format ints and addresses. + If the host implements 64-bit values, it defines BFD_HOST_64_BIT to + be the appropriate type. Otherwise, this code will fall back on + gcc's "long long" type if gcc is being used. BFD_HOST_64_BIT must + be defined in such a way as to be a valid type name by itself or + with "unsigned" prefixed. It should be a signed type by itself. - If neither is the case, then compilation will fail if 64-bit targets are - requested. If you don't request any 64-bit targets, you should be safe. */ + If neither is the case, then compilation will fail if 64-bit + targets are requested. If you don't request any 64-bit targets, + you should be safe. */ #ifdef BFD64 @@ -213,7 +214,8 @@ typedef enum bfd_format { #define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to - do something). */ + do something) (sometimes bfd_relax_section can do something even if + this is not set). */ #define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a @@ -271,7 +273,6 @@ typedef struct lineno_cache_entry { /* object and core file sections */ - #define align_power(addr, align) \ ( ((addr) + ((1<<(align))-1)) & (-1 << (align))) @@ -424,6 +425,18 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, /* User program access to BFD facilities */ +/* Direct I/O routines, for programs which know more about the object + file than BFD does. Use higher level routines if possible. */ + +extern bfd_size_type bfd_read + PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); +extern bfd_size_type bfd_write + PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); +extern int bfd_seek PARAMS ((bfd *abfd, const file_ptr fp, int direction)); +extern long bfd_tell PARAMS ((bfd *abfd)); +extern int bfd_flush PARAMS ((bfd *abfd)); +extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); + /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ #define bfd_get_filename(abfd) ((char *) (abfd)->filename) @@ -532,9 +545,12 @@ extern boolean bfd_elf32_record_link_assignment extern boolean bfd_elf64_record_link_assignment PARAMS ((bfd *, struct bfd_link_info *, const char *)); extern boolean bfd_elf32_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, struct sec **)); + PARAMS ((bfd *, const char *, const char *, struct bfd_link_info *, + struct sec **)); extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, struct sec **)); + PARAMS ((bfd *, const char *, const char *, struct bfd_link_info *, + struct sec **)); +extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); /* SunOS shared library support routines for the linker. */ @@ -544,6 +560,11 @@ extern boolean bfd_sunos_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, struct sec **)); +/* Linux shared library support routines for the linker. */ + +extern boolean bfd_linux_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + /* And more from the source. */ void bfd_init PARAMS ((void)); @@ -742,7 +763,7 @@ typedef struct sec multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we - translate to bfd_com_section), but ECOFF has two. */ + translate to bfd_com_section_ptr), but ECOFF has two. */ #define SEC_IS_COMMON 0x8000 /* The section contains only debugging information. For @@ -877,28 +898,36 @@ typedef struct sec struct bfd_link_order *link_order_tail; } asection ; - /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in - these sections. */ + these sections. New code should use the section_ptr macros rather + than referring directly to the const sections. The const sections + may eventually vanish. */ #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" #define BFD_COM_SECTION_NAME "*COM*" #define BFD_IND_SECTION_NAME "*IND*" /* the absolute section */ -extern asection bfd_abs_section; +extern const asection bfd_abs_section; +#define bfd_abs_section_ptr ((asection *) &bfd_abs_section) +#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) /* Pointer to the undefined section */ -extern asection bfd_und_section; +extern const asection bfd_und_section; +#define bfd_und_section_ptr ((asection *) &bfd_und_section) +#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) /* Pointer to the common section */ -extern asection bfd_com_section; +extern const asection bfd_com_section; +#define bfd_com_section_ptr ((asection *) &bfd_com_section) /* Pointer to the indirect section */ -extern asection bfd_ind_section; - -extern struct symbol_cache_entry *bfd_abs_symbol; -extern struct symbol_cache_entry *bfd_com_symbol; -extern struct symbol_cache_entry *bfd_und_symbol; -extern struct symbol_cache_entry *bfd_ind_symbol; +extern const asection bfd_ind_section; +#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) +#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) + +extern const struct symbol_cache_entry * const bfd_abs_symbol; +extern const struct symbol_cache_entry * const bfd_com_symbol; +extern const struct symbol_cache_entry * const bfd_und_symbol; +extern const struct symbol_cache_entry * const bfd_ind_symbol; #define bfd_get_section_size_before_reloc(section) \ (section->reloc_done ? (abort(),1): (section)->_raw_size) #define bfd_get_section_size_after_reloc(section) \ @@ -968,6 +997,9 @@ enum bfd_architecture #define bfd_mach_i960_mc 4 #define bfd_mach_i960_xa 5 #define bfd_mach_i960_ca 6 + /* start-sanitize-i960xl */ +#define bfd_mach_i960_xl 7 + /* end-sanitize-i960xl */ bfd_arch_a29k, /* AMD 29000 */ bfd_arch_sparc, /* SPARC */ @@ -993,6 +1025,7 @@ enum bfd_architecture bfd_arch_h8500, /* Hitachi H8/500 */ bfd_arch_sh, /* Hitachi SH */ bfd_arch_alpha, /* Dec Alpha */ + bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_last }; @@ -1127,7 +1160,10 @@ enum complain_overflow complain_overflow_unsigned }; -typedef struct reloc_howto_struct +typedef unsigned char bfd_byte; +typedef struct reloc_howto_struct reloc_howto_type; + +struct reloc_howto_struct { /* The type field has mainly a documetary use - the back end can do what it wants with it, though normally the back end's @@ -1207,7 +1243,7 @@ typedef struct reloc_howto_struct empty (e.g., m88k bcs); this flag signals the fact.*/ boolean pcrel_offset; -} reloc_howto_type; +}; #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC} #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) @@ -1226,8 +1262,6 @@ typedef struct reloc_howto_struct int bfd_get_reloc_size PARAMS ((const reloc_howto_type *)); -typedef unsigned char bfd_byte; - typedef struct relent_chain { arelent relent; struct relent_chain *next; @@ -1316,7 +1350,8 @@ typedef enum bfd_reloc_code_real BFD_RELOC_SPARC_BASE13, BFD_RELOC_SPARC_BASE22, - /* start-sanitize-v9 */ + /* some relocations we're using for sparc v9 + -- subject to change */ BFD_RELOC_SPARC_10, BFD_RELOC_SPARC_11, #define BFD_RELOC_SPARC_64 BFD_RELOC_64 @@ -1331,7 +1366,6 @@ typedef enum bfd_reloc_code_real BFD_RELOC_SPARC_WDISP19, BFD_RELOC_SPARC_GLOB_JMP, BFD_RELOC_SPARC_LO7, - /* end-sanitize-v9 */ /* Alpha ECOFF relocations. Some of these treat the symbol or "addend" in some special way. */ @@ -1412,6 +1446,20 @@ typedef enum bfd_reloc_code_real BFD_RELOC_386_GOTOFF, BFD_RELOC_386_GOTPC, + /* ns32k relocations */ + BFD_RELOC_NS32K_IMM_8, + BFD_RELOC_NS32K_IMM_16, + BFD_RELOC_NS32K_IMM_32, + BFD_RELOC_NS32K_IMM_8_PCREL, + BFD_RELOC_NS32K_IMM_16_PCREL, + BFD_RELOC_NS32K_IMM_32_PCREL, + BFD_RELOC_NS32K_DISP_8, + BFD_RELOC_NS32K_DISP_16, + BFD_RELOC_NS32K_DISP_32, + BFD_RELOC_NS32K_DISP_8_PCREL, + BFD_RELOC_NS32K_DISP_16_PCREL, + BFD_RELOC_NS32K_DISP_32_PCREL, + /* PowerPC/POWER (RS/6000) relocs. */ /* 26 bit relative branch. Low two bits must be zero. High 24 bits installed in bits 6 through 29 of instruction. */ @@ -1572,7 +1620,7 @@ struct _bfd CONST char *filename; /* A pointer to the target jump table. */ - struct bfd_target *xvec; + const struct bfd_target *xvec; /* To avoid dragging too many header files into every file that includes `<>', IOSTREAM has been declared as a "char @@ -1809,6 +1857,9 @@ bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); #define 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)) + #define bfd_set_arch_mach(abfd, arch, mach)\ BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) @@ -1932,7 +1983,7 @@ typedef struct bfd_target bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); - struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); + const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); @@ -1980,7 +2031,8 @@ CAT(NAME,_slurp_extended_name_table),\ CAT(NAME,_truncate_arname),\ CAT(NAME,_write_armap),\ CAT(NAME,_openr_next_archived_file),\ -CAT(NAME,_generic_stat_arch_elt) +CAT(NAME,_generic_stat_arch_elt),\ +CAT(NAME,_update_armap_timestamp) boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); @@ -1989,9 +2041,10 @@ CAT(NAME,_generic_stat_arch_elt) struct orl *map, unsigned int orl_count, int stridx)); - bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); - int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); - + bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); + int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); + boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); + /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ CAT(NAME,_get_symtab_upper_bound),\ @@ -2100,10 +2153,10 @@ CAT(NAME,_canonicalize_dynamic_reloc) PTR backend_data; } bfd_target; -bfd_target * +const bfd_target * bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd)); -CONST char ** +const char ** bfd_target_list PARAMS ((void)); boolean