X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fbfd-in2.h;h=16609cb0b6254b13301f48b3955fa0d61b5bbe75;hb=6c7c4ca467457417ac60105e72a8379f3de16b35;hp=813d748be9793dd7a52ee8bbe434e78c3d4a9ffa;hpb=23fe95776c0a1c4b4f59f09ce6a4b5635170dc43;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 813d748be9..16609cb0b6 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2,13 +2,13 @@ generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", - "linker.c" and "simple.c". + "linker.c", "simple.c" and "compress.c". 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, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -17,7 +17,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -53,9 +53,8 @@ extern "C" { /* This is a utility macro to handle the situation where the code wants to place a constant string into the code, followed by a comma and then the length of the string. Doing this by hand - is error prone, so using this macro is safer. The macro will - also safely handle the case where a NULL is passed as the arg. */ -#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0) + is error prone, so using this macro is safer. */ +#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1) /* Unfortunately it is not possible to use the STRING_COMMA_LEN macro to create the arguments to another macro, since the preprocessor will mis-count the number of arguments to the outer macro (by not @@ -83,7 +82,7 @@ extern "C" { #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ -#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@ +#define BFD_HOST_64BIT_LONG_LONG @BFD_HOST_64BIT_LONG_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@ @@ -103,6 +102,10 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif #endif +/* Declaring a type wide enough to hold a host long and a host pointer. */ +#define BFD_HOSTPTR_T @BFD_HOSTPTR_T@ +typedef BFD_HOSTPTR_T bfd_hostptr_t; + /* Forward declaration. */ typedef struct bfd bfd; @@ -132,18 +135,17 @@ typedef BFD_HOST_64_BIT bfd_signed_vma; typedef BFD_HOST_U_64_BIT bfd_size_type; typedef BFD_HOST_U_64_BIT symvalue; -#ifndef fprintf_vma #if BFD_HOST_64BIT_LONG -#define sprintf_vma(s,x) sprintf (s, "%016lx", x) -#define fprintf_vma(f,x) fprintf (f, "%016lx", x) +#define BFD_VMA_FMT "l" +#elif defined (__MSVCRT__) +#define BFD_VMA_FMT "I64" #else -#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff))) -#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) -#define fprintf_vma(s,x) \ - fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) -#define sprintf_vma(s,x) \ - sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) +#define BFD_VMA_FMT "ll" #endif + +#ifndef fprintf_vma +#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x) +#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x) #endif #else /* not BFD64 */ @@ -163,8 +165,9 @@ typedef unsigned long symvalue; typedef unsigned long bfd_size_type; /* Print a bfd_vma x on stream s. */ -#define fprintf_vma(s,x) fprintf (s, "%08lx", x) -#define sprintf_vma(s,x) sprintf (s, "%08lx", x) +#define BFD_VMA_FMT "l" +#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x) +#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x) #endif /* not BFD64 */ @@ -205,70 +208,6 @@ typedef enum bfd_format bfd_type_end /* Marks the end; don't use it! */ } bfd_format; - -/* Values that may appear in the flags field of a BFD. These also - appear in the object_flags field of the bfd_target structure, where - they indicate the set of flags used by that backend (not all flags - are meaningful for all object file formats) (FIXME: at the moment, - the object_flags values have mostly just been copied from backend - to another, and are not necessarily correct). */ - -/* No flags. */ -#define BFD_NO_FLAGS 0x00 - -/* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 - -/* BFD is directly executable. */ -#define EXEC_P 0x02 - -/* BFD has line number information (basically used for F_LNNO in a - COFF header). */ -#define HAS_LINENO 0x04 - -/* BFD has debugging information. */ -#define HAS_DEBUG 0x08 - -/* BFD has symbols. */ -#define HAS_SYMS 0x10 - -/* BFD has local symbols (basically used for F_LSYMS in a COFF - header). */ -#define HAS_LOCALS 0x20 - -/* BFD is a dynamic object. */ -#define DYNAMIC 0x40 - -/* Text section is write protected (if D_PAGED is not set, this is - like an a.out NMAGIC file) (the linker sets this by default, but - clears it for -r or -N). */ -#define WP_TEXT 0x80 - -/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the - linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 - -/* BFD is relaxable (this means that bfd_relax_section may be able to - 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 - traditional format. For example, this is used to request that when - writing out an a.out object the symbols not be hashed to eliminate - duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 - -/* This flag indicates that the BFD contents are actually cached in - memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - -/* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 - -/* This BFD has been created by the linker and doesn't correspond - to any input file. */ -#define BFD_LINKER_CREATED 0x2000 /* Symbols and relocation. */ @@ -291,7 +230,10 @@ typedef const struct reloc_howto_struct reloc_howto_type; #define bfd_asymbol_name(x) ((x)->name) /*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ #define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour) +#define bfd_asymbol_flavour(x) \ + (((x)->flags & BSF_SYNTHETIC) != 0 \ + ? bfd_target_unknown_flavour \ + : bfd_asymbol_bfd (x)->xvec->flavour) /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ @@ -357,7 +299,15 @@ typedef struct bfd_section *sec_ptr; (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ / bfd_octets_per_byte (bfd)) -typedef struct stat stat_type; +/* Return TRUE if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section (sec) \ + && bfd_is_abs_section ((sec)->output_section) \ + && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ + && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) + +/* Forward define. */ +struct stat; typedef enum bfd_print_symbol { @@ -405,12 +355,6 @@ struct bfd_hash_table { /* The hash array. */ struct bfd_hash_entry **table; - /* The number of slots in the hash table. */ - unsigned int size; - /* The number of entries in the hash table. */ - unsigned int count; - /* The size of elements. */ - unsigned int entsize; /* A function used to create new elements in the hash table. The first entry is itself a pointer to an element. When this function is first invoked, this pointer will be NULL. However, @@ -423,6 +367,14 @@ struct bfd_hash_table /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; + /* The number of slots in the hash table. */ + unsigned int size; + /* The number of entries in the hash table. */ + unsigned int count; + /* The size of elements. */ + unsigned int entsize; + /* If non-zero, don't grow the hash table. */ + unsigned int frozen:1; }; /* Initialize a hash table. */ @@ -453,6 +405,10 @@ extern struct bfd_hash_entry *bfd_hash_lookup (struct bfd_hash_table *, const char *, bfd_boolean create, bfd_boolean copy); +/* Insert an entry in a hash table. */ +extern struct bfd_hash_entry *bfd_hash_insert + (struct bfd_hash_table *, const char *, unsigned long); + /* Replace an entry in a hash table. */ extern void bfd_hash_replace (struct bfd_hash_table *, struct bfd_hash_entry *old, @@ -545,6 +501,7 @@ extern void warn_deprecated (const char *, const char *, int, const char *); #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) #define bfd_my_archive(abfd) ((abfd)->my_archive) #define bfd_has_map(abfd) ((abfd)->has_armap) +#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) #define bfd_usrdata(abfd) ((abfd)->usrdata) @@ -757,6 +714,8 @@ extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); + extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); @@ -850,6 +809,27 @@ extern bfd_boolean bfd_coff_set_symbol_class extern bfd_boolean bfd_m68k_coff_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +/* ARM VFP11 erratum workaround support. */ +typedef enum +{ + BFD_ARM_VFP11_FIX_DEFAULT, + BFD_ARM_VFP11_FIX_NONE, + BFD_ARM_VFP11_FIX_SCALAR, + BFD_ARM_VFP11_FIX_VECTOR +} bfd_arm_vfp11_fix; + +extern void bfd_elf32_arm_init_maps + (bfd *); + +extern void bfd_elf32_arm_set_vfp11_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_vfp11_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -875,10 +855,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *); extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); + (bfd *, struct bfd_link_info *); void bfd_elf32_arm_set_target_relocs - (struct bfd_link_info *, int, char *, int, int); + (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, + int, int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -894,6 +875,8 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd extern bfd_boolean bfd_is_arm_special_symbol_name (const char * name, int type); +extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); + /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines (bfd *, bfd *); @@ -904,6 +887,17 @@ extern bfd_boolean bfd_arm_update_notes extern unsigned int bfd_arm_get_mach_from_notes (bfd *, const char *); +/* ARM stub generation support. Called from the linker. */ +extern int elf32_arm_setup_section_lists + (bfd *, struct bfd_link_info *); +extern void elf32_arm_next_input_section + (struct bfd_link_info *, struct bfd_section *); +extern bfd_boolean elf32_arm_size_stubs + (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, + struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); +extern bfd_boolean elf32_arm_build_stubs + (struct bfd_link_info *); + /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page (struct bfd_section *, int); @@ -965,7 +959,10 @@ bfd *bfd_openr_iovec (const char *filename, const char *target, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)); + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)); bfd *bfd_openw (const char *filename, const char *target); @@ -1106,7 +1103,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -long bfd_get_size (bfd *abfd); +file_ptr bfd_get_size (bfd *abfd); /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ @@ -1228,7 +1225,7 @@ typedef struct bfd_section /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0x40000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ @@ -1237,11 +1234,11 @@ typedef struct bfd_section /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ -#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000 +#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections contain different @@ -1253,26 +1250,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x200000 +#define SEC_LINKER_CREATED 0x100000 - /* This section should not be subject to garbage collection. */ -#define SEC_KEEP 0x400000 + /* This section should not be subject to garbage collection. + Also set to inform the linker that this section should not be + listed in the link map as discarded. */ +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x800000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x1000000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x2000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x4000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1283,23 +1282,23 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x10000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x20000000 +#define SEC_COFF_SHARED 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x40000000 +#define SEC_TIC54X_BLOCK 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x80000000 +#define SEC_TIC54X_CLINK 0x20000000 /* End of section flags. */ @@ -1315,9 +1314,8 @@ typedef struct bfd_section output sections that have an input section. */ unsigned int linker_has_input : 1; - /* Mark flags used by some linker backends for garbage collection. */ + /* Mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; - unsigned int gc_mark_from_eh : 1; /* The following flags are used by the ELF linker. */ @@ -1371,13 +1369,13 @@ typedef struct bfd_section bfd_size_type size; /* For input sections, the original size on disk of the section, in - octets. This field is used by the linker relaxation code. It is - currently only set for sections where the linker relaxation scheme - doesn't cache altered section and reloc contents (stabs, eh_frame, - SEC_MERGE, some coff relaxing targets), and thus the original size - needs to be kept to read the section multiple times. - For output sections, rawsize holds the section size calculated on - a previous linker relaxation pass. */ + octets. This field should be set for any section whose size is + changed by linker relaxation. It is required for sections where + the linker relaxation scheme doesn't cache altered section and + reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing + targets), and thus the original size needs to be kept to read the + section multiple times. For output sections, rawsize holds the + section size calculated on a previous linker relaxation pass. */ bfd_size_type rawsize; /* If this section is going to be output, then this value is the @@ -1595,8 +1593,8 @@ extern asection bfd_ind_section; /* name, id, index, next, prev, flags, user_set_vma, */ \ { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ - /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \ - 0, 0, 1, 0, \ + /* linker_mark, linker_has_input, gc_mark, */ \ + 0, 0, 1, \ \ /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \ 0, 0, 0, 0, \ @@ -1705,22 +1703,29 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 -#define bfd_mach_mcf_isa_a_nodiv 9 -#define bfd_mach_mcf_isa_a 10 -#define bfd_mach_mcf_isa_a_mac 11 -#define bfd_mach_mcf_isa_a_emac 12 -#define bfd_mach_mcf_isa_aplus 13 -#define bfd_mach_mcf_isa_aplus_mac 14 -#define bfd_mach_mcf_isa_aplus_emac 15 -#define bfd_mach_mcf_isa_b_nousp 16 -#define bfd_mach_mcf_isa_b_nousp_mac 17 -#define bfd_mach_mcf_isa_b_nousp_emac 18 -#define bfd_mach_mcf_isa_b 19 -#define bfd_mach_mcf_isa_b_mac 20 -#define bfd_mach_mcf_isa_b_emac 21 -#define bfd_mach_mcf_isa_b_float 22 -#define bfd_mach_mcf_isa_b_float_mac 23 -#define bfd_mach_mcf_isa_b_float_emac 24 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -1786,7 +1791,10 @@ enum bfd_architecture #define bfd_mach_mips12000 12000 #define bfd_mach_mips16 16 #define bfd_mach_mips5 5 +#define bfd_mach_mips_loongson_2e 3001 +#define bfd_mach_mips_loongson_2f 3002 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_octeon 6501 #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 #define bfd_mach_mipsisa64 64 @@ -1835,6 +1843,7 @@ enum bfd_architecture #define bfd_mach_ppc_rs64iii 643 #define bfd_mach_ppc_7400 7400 #define bfd_mach_ppc_e500 500 +#define bfd_mach_ppc_e500mc 5001 bfd_arch_rs6000, /* IBM RS/6000 */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 @@ -1942,6 +1951,9 @@ enum bfd_architecture #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 bfd_arch_mcore, + bfd_arch_mep, +#define bfd_mach_mep 1 +#define bfd_mach_mep_h1 0x6831 bfd_arch_ia64, /* HP/Intel ia64 */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 @@ -1959,12 +1971,18 @@ enum bfd_architecture bfd_arch_avr, /* Atmel AVR microcontrollers. */ #define bfd_mach_avr1 1 #define bfd_mach_avr2 2 +#define bfd_mach_avr25 25 #define bfd_mach_avr3 3 +#define bfd_mach_avr31 31 +#define bfd_mach_avr35 35 #define bfd_mach_avr4 4 #define bfd_mach_avr5 5 +#define bfd_mach_avr51 51 #define bfd_mach_avr6 6 bfd_arch_bfin, /* ADI Blackfin */ #define bfd_mach_bfin 1 + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ +#define bfd_mach_cr16 1 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ #define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ @@ -2394,6 +2412,11 @@ relocation types already defined. */ BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32, BFD_RELOC_SPARC_UA64, + BFD_RELOC_SPARC_GOTDATA_HIX22, + BFD_RELOC_SPARC_GOTDATA_LOX10, + BFD_RELOC_SPARC_GOTDATA_OP_HIX22, + BFD_RELOC_SPARC_GOTDATA_OP_LOX10, + BFD_RELOC_SPARC_GOTDATA_OP, /* I think these are specific to SPARC a.out (e.g., Sun 4). */ BFD_RELOC_SPARC_BASE13, @@ -2467,6 +2490,8 @@ relocation types already defined. */ BFD_RELOC_SPU_PCREL16, BFD_RELOC_SPU_LO16, BFD_RELOC_SPU_HI16, + BFD_RELOC_SPU_PPU32, + BFD_RELOC_SPU_PPU64, /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or "addend" in some special way. @@ -2583,6 +2608,11 @@ to compensate for the borrow when the low bits are added. */ /* Low 16 bits of pc-relative value */ BFD_RELOC_LO16_PCREL, +/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of +16-bit immediate fields */ + BFD_RELOC_MIPS16_GOT16, + BFD_RELOC_MIPS16_CALL16, + /* MIPS16 high 16 bits of 32-bit value. */ BFD_RELOC_MIPS16_HI16, @@ -2635,7 +2665,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MIPS_TLS_TPREL_LO16, -/* MIPS ELF relocations (VxWorks extensions). */ +/* MIPS ELF relocations (VxWorks and PLT extensions). */ BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT, @@ -2709,6 +2739,16 @@ in the instruction. */ /* Adjust by program base. */ BFD_RELOC_MN10300_RELATIVE, +/* Together with another reloc targeted at the same location, +allows for a value that is the difference of two symbols +in the same section. */ + BFD_RELOC_MN10300_SYM_DIFF, + +/* The addend of this reloc is an alignment power that must +be honoured at the offset's location, regardless of linker +relaxation. */ + BFD_RELOC_MN10300_ALIGN, + /* i386/elf relocations */ BFD_RELOC_386_GOT32, @@ -3009,6 +3049,9 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_LDC_SB_G1, BFD_RELOC_ARM_LDC_SB_G2, +/* Annotation of BX instructions. */ + BFD_RELOC_ARM_V4BX, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3528,6 +3571,29 @@ short offset into 11 bits. */ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, BFD_RELOC_MCORE_RVA, +/* Toshiba Media Processor Relocations. */ + BFD_RELOC_MEP_8, + BFD_RELOC_MEP_16, + BFD_RELOC_MEP_32, + BFD_RELOC_MEP_PCREL8A2, + BFD_RELOC_MEP_PCREL12A2, + BFD_RELOC_MEP_PCREL17A2, + BFD_RELOC_MEP_PCREL24A2, + BFD_RELOC_MEP_PCABS24A2, + BFD_RELOC_MEP_LOW16, + BFD_RELOC_MEP_HI16U, + BFD_RELOC_MEP_HI16S, + BFD_RELOC_MEP_GPREL, + BFD_RELOC_MEP_TPREL, + BFD_RELOC_MEP_TPREL7, + BFD_RELOC_MEP_TPREL7A2, + BFD_RELOC_MEP_TPREL7A4, + BFD_RELOC_MEP_UIMM24, + BFD_RELOC_MEP_ADDR24A4, + BFD_RELOC_MEP_GNU_VTINHERIT, + BFD_RELOC_MEP_GNU_VTENTRY, + + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4032,6 +4098,38 @@ This is the 5 bits of a value. */ BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C, +/* NS CR16 Relocations. */ + BFD_RELOC_CR16_NUM8, + BFD_RELOC_CR16_NUM16, + BFD_RELOC_CR16_NUM32, + BFD_RELOC_CR16_NUM32a, + BFD_RELOC_CR16_REGREL0, + BFD_RELOC_CR16_REGREL4, + BFD_RELOC_CR16_REGREL4a, + BFD_RELOC_CR16_REGREL14, + BFD_RELOC_CR16_REGREL14a, + BFD_RELOC_CR16_REGREL16, + BFD_RELOC_CR16_REGREL20, + BFD_RELOC_CR16_REGREL20a, + BFD_RELOC_CR16_ABS20, + BFD_RELOC_CR16_ABS24, + BFD_RELOC_CR16_IMM4, + BFD_RELOC_CR16_IMM8, + BFD_RELOC_CR16_IMM16, + BFD_RELOC_CR16_IMM20, + BFD_RELOC_CR16_IMM24, + BFD_RELOC_CR16_IMM32, + BFD_RELOC_CR16_IMM32a, + BFD_RELOC_CR16_DISP4, + BFD_RELOC_CR16_DISP8, + BFD_RELOC_CR16_DISP16, + BFD_RELOC_CR16_DISP20, + BFD_RELOC_CR16_DISP24, + BFD_RELOC_CR16_DISP24a, + BFD_RELOC_CR16_SWITCH8, + BFD_RELOC_CR16_SWITCH16, + BFD_RELOC_CR16_SWITCH32, + /* NS CRX Relocations. */ BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8, @@ -4094,6 +4192,19 @@ This is the 5 bits of a value. */ /* 32-bit offset to symbol with PLT entry, relative to this relocation. */ BFD_RELOC_CRIS_32_PLT_PCREL, +/* Relocs used in TLS code for CRIS. */ + BFD_RELOC_CRIS_32_GOT_GD, + BFD_RELOC_CRIS_16_GOT_GD, + BFD_RELOC_CRIS_32_GD, + BFD_RELOC_CRIS_DTP, + BFD_RELOC_CRIS_32_DTPREL, + BFD_RELOC_CRIS_16_DTPREL, + BFD_RELOC_CRIS_32_GOT_TPREL, + BFD_RELOC_CRIS_16_GOT_TPREL, + BFD_RELOC_CRIS_32_TPREL, + BFD_RELOC_CRIS_16_TPREL, + BFD_RELOC_CRIS_DTPMOD, + /* Intel i860 Relocations. */ BFD_RELOC_860_COPY, BFD_RELOC_860_GLOB_DAT, @@ -4145,6 +4256,10 @@ This is the 5 bits of a value. */ BFD_RELOC_XSTORMY16_24, BFD_RELOC_XSTORMY16_FPTR16, +/* Self-describing complex relocations. */ + BFD_RELOC_RELC, + + /* Infineon Relocations. */ BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, @@ -4267,6 +4382,15 @@ internally by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND. */ BFD_RELOC_XTENSA_ASM_SIMPLIFY, +/* Xtensa TLS relocations. */ + BFD_RELOC_XTENSA_TLSDESC_FN, + BFD_RELOC_XTENSA_TLSDESC_ARG, + BFD_RELOC_XTENSA_TLS_DTPOFF, + BFD_RELOC_XTENSA_TLS_TPOFF, + BFD_RELOC_XTENSA_TLS_FUNC, + BFD_RELOC_XTENSA_TLS_ARG, + BFD_RELOC_XTENSA_TLS_CALL, + /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, @@ -4282,6 +4406,8 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); +reloc_howto_type *bfd_reloc_name_lookup + (bfd *abfd, const char *reloc_name); const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); @@ -4394,6 +4520,17 @@ typedef struct bfd_symbol /* This symbol is thread local. Used in ELF. */ #define BSF_THREAD_LOCAL 0x40000 + /* This symbol represents a complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_RELC 0x80000 + + /* This symbol represents a signed complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_SRELC 0x100000 + + /* This symbol was created by bfd_get_synthetic_symtab. */ +#define BSF_SYNTHETIC 0x200000 + flagword flags; /* A pointer to the section to which this symbol is @@ -4472,15 +4609,6 @@ struct bfd void *iostream; const struct bfd_iovec *iovec; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - bfd_boolean cacheable; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - bfd_boolean target_defaulted; - /* The caching routines use these to maintain a least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; @@ -4489,13 +4617,6 @@ struct bfd state information on the file here... */ ufile_ptr where; - /* ... and here: (``once'' means at least once). */ - bfd_boolean opened_once; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - bfd_boolean mtime_set; - /* File modified time, if mtime_set is TRUE. */ long mtime; @@ -4518,14 +4639,81 @@ struct bfd /* Format_specific flags. */ flagword flags; + /* Values that may appear in the flags field of a BFD. These also + appear in the object_flags field of the bfd_target structure, where + they indicate the set of flags used by that backend (not all flags + are meaningful for all object file formats) (FIXME: at the moment, + the object_flags values have mostly just been copied from backend + to another, and are not necessarily correct). */ + +#define BFD_NO_FLAGS 0x00 + + /* BFD contains relocation entries. */ +#define HAS_RELOC 0x01 + + /* BFD is directly executable. */ +#define EXEC_P 0x02 + + /* BFD has line number information (basically used for F_LNNO in a + COFF header). */ +#define HAS_LINENO 0x04 + + /* BFD has debugging information. */ +#define HAS_DEBUG 0x08 + + /* BFD has symbols. */ +#define HAS_SYMS 0x10 + + /* BFD has local symbols (basically used for F_LSYMS in a COFF + header). */ +#define HAS_LOCALS 0x20 + + /* BFD is a dynamic object. */ +#define DYNAMIC 0x40 + + /* Text section is write protected (if D_PAGED is not set, this is + like an a.out NMAGIC file) (the linker sets this by default, but + clears it for -r or -N). */ +#define WP_TEXT 0x80 + + /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the + linker sets this by default, but clears it for -r or -n or -N). */ +#define D_PAGED 0x100 + + /* BFD is relaxable (this means that bfd_relax_section may be able to + 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 + traditional format. For example, this is used to request that when + writing out an a.out object the symbols not be hashed to eliminate + duplicates. */ +#define BFD_TRADITIONAL_FORMAT 0x400 + + /* This flag indicates that the BFD contents are actually cached + in memory. If this is set, iostream points to a bfd_in_memory + struct. */ +#define BFD_IN_MEMORY 0x800 + + /* The sections in this BFD specify a memory page. */ +#define HAS_LOAD_PAGE 0x1000 + + /* This BFD has been created by the linker and doesn't correspond + to any input file. */ +#define BFD_LINKER_CREATED 0x2000 + /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of origin, with origin set to 0 for non archive files. */ ufile_ptr origin; - /* Remember when output has begun, to stop strange things - from happening. */ - bfd_boolean output_has_begun; + /* The origin in the archive of the proxy entry. This will + normally be the same as origin, except for thin archives, + when it will contain the current offset of the proxy in the + thin archive rather than the offset of the bfd in its actual + container. */ + ufile_ptr proxy_origin; /* A hash table for section names. */ struct bfd_hash_table section_htab; @@ -4546,7 +4734,8 @@ struct bfd /* Used for input and output. */ unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). */ + /* Symbol table for output BFD (with symcount entries). + Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; /* Used for slurped dynamic symbol tables. */ @@ -4555,15 +4744,13 @@ struct bfd /* Pointer to structure which contains architecture information. */ const struct bfd_arch_info *arch_info; - /* Flag set if symbols from this BFD should not be exported. */ - bfd_boolean no_export; - /* Stuff only useful for archives. */ void *arelt_data; struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *next; /* The next BFD in the archive. */ + struct bfd *archive_next; /* The next BFD in the archive. */ struct bfd *archive_head; /* The first BFD in the archive. */ - bfd_boolean has_armap; + struct bfd *nested_archives; /* List of nested archive in a flattened + thin archive. */ /* A chain of BFD structures involved in a link. */ struct bfd *link_next; @@ -4620,6 +4807,35 @@ struct bfd struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; }; typedef enum bfd_error @@ -4643,13 +4859,14 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_on_input, bfd_error_invalid_error_code } bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag); +void bfd_set_error (bfd_error_type error_tag, ...); const char *bfd_errmsg (bfd_error_type error_tag); @@ -4821,6 +5038,8 @@ bfd_vma bfd_emul_get_commonpagesize (const char *); void bfd_emul_set_commonpagesize (const char *, bfd_vma); +char *bfd_demangle (bfd *, const char *, int); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -5119,7 +5338,8 @@ typedef struct bfd_target #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup + NAME##_bfd_reloc_type_lookup, \ + NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); long (*_bfd_canonicalize_reloc) @@ -5127,6 +5347,9 @@ typedef struct bfd_target /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); + reloc_howto_type * + (*reloc_name_lookup) (bfd *, const char *); + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ @@ -5198,7 +5421,8 @@ typedef struct bfd_target /* Check if SEC has been already linked during a reloceatable or final link. */ - void (*_section_already_linked) (bfd *, struct bfd_section *); + void (*_section_already_linked) (bfd *, struct bfd_section *, + struct bfd_link_info *); /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ @@ -5258,15 +5482,20 @@ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) -void bfd_section_already_linked (bfd *abfd, asection *sec); +void bfd_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info); -#define bfd_section_already_linked(abfd, sec) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec)) +#define bfd_section_already_linked(abfd, sec, info) \ + BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); +/* Extracted from compress.c. */ +bfd_boolean bfd_uncompress_section_contents + (bfd_byte **buffer, bfd_size_type *size); + #ifdef __cplusplus } #endif