]> Git Repo - binutils.git/blobdiff - bfd/bfd-in2.h
Fri Apr 15 11:53:46 1994 Stan Shebs ([email protected])
[binutils.git] / bfd / bfd-in2.h
index 7bad1b1859d32b6521f0c9084cb28923fc7f0f07..997abcd29021ca4d1cf29dc60fd972cb8175eae0 100644 (file)
@@ -1,5 +1,5 @@
 /* Main header file for the bfd library -- portable access to object files.
-   Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 ** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
@@ -47,8 +47,8 @@ here.  */
 #include "ansidecl.h"
 #include "obstack.h"
 
-#define BFD_VERSION "2.2"
-
+/* These two lines get substitutions done by commands in Makefile.in.  */
+#define BFD_VERSION   "@VERSION@"
 #define BFD_ARCH_SIZE @WORDSIZE@
 
 #if BFD_ARCH_SIZE >= 64
@@ -100,9 +100,9 @@ typedef enum bfd_boolean {bfd_false, bfd_true} boolean;
 typedef long int file_ptr;
 
 /* Support for different sizes of target format ints and addresses.  If the
-   host implements 64-bit values, it defines HOST_64_BIT to be the appropriate
+   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.  HOST_64_BIT must be defined in such a way as to be a valid
+   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.
 
@@ -111,27 +111,31 @@ typedef long int file_ptr;
 
 #ifdef BFD64
 
-#if defined (__GNUC__) && !defined (HOST_64_BIT)
-#define HOST_64_BIT long long
-typedef HOST_64_BIT int64_type;
-typedef unsigned HOST_64_BIT uint64_type;
+#if defined (__GNUC__) && !defined (BFD_HOST_64_BIT)
+#define BFD_HOST_64_BIT long long
+typedef BFD_HOST_64_BIT int64_type;
+typedef unsigned BFD_HOST_64_BIT uint64_type;
 #endif
 
 #if !defined (uint64_type) && defined (__GNUC__)
 #define uint64_type unsigned long long
 #define int64_type long long
+#endif
+#ifndef uint64_typeLOW
 #define uint64_typeLOW(x) ((unsigned long)(((x) & 0xffffffff)))
 #define uint64_typeHIGH(x) ((unsigned long)(((x) >> 32) & 0xffffffff))
 #endif
 
-typedef unsigned HOST_64_BIT bfd_vma;
-typedef HOST_64_BIT bfd_signed_vma;
-typedef unsigned HOST_64_BIT bfd_size_type;
-typedef unsigned HOST_64_BIT symvalue;
+typedef unsigned BFD_HOST_64_BIT bfd_vma;
+typedef BFD_HOST_64_BIT bfd_signed_vma;
+typedef unsigned BFD_HOST_64_BIT bfd_size_type;
+typedef unsigned BFD_HOST_64_BIT symvalue;
+#ifndef fprintf_vma
 #define fprintf_vma(s,x) \
                fprintf(s,"%08lx%08lx", uint64_typeHIGH(x), uint64_typeLOW(x))
 #define sprintf_vma(s,x) \
                sprintf(s,"%08lx%08lx", uint64_typeHIGH(x), uint64_typeLOW(x))
+#endif
 #else /* not BFD64  */
 
 /* Represent a target address.  Also used as a generic unsigned type
@@ -214,22 +218,13 @@ typedef enum bfd_format {
 \f
 /* symbols and relocation */
 
+/* A count of carsyms (canonical archive symbols).  */
 typedef unsigned long symindex;
 
 #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
 
-typedef enum bfd_symclass {
-             bfd_symclass_unknown = 0,
-             bfd_symclass_fcommon, /* fortran common symbols */
-             bfd_symclass_global, /* global symbol, what a surprise */
-             bfd_symclass_debugger, /* some debugger symbol */
-             bfd_symclass_undefined /* none known */
-           } symclass;
-
-
-/* general purpose part of a symbol;
-   target specific parts will be found in libcoff.h, liba.out.h etc */
-
+/* General purpose part of a symbol X;
+   target specific parts are in libcoff.h, libaout.h, etc.  */
 
 #define bfd_get_section(x) ((x)->section)
 #define bfd_get_output_section(x) ((x)->section->output_section)
@@ -241,6 +236,7 @@ typedef enum bfd_symclass {
 #define bfd_asymbol_bfd(x) ((x)->the_bfd)
 #define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
 
+/* A canonical archive symbol.  */
 /* This is a type pun with struct ranlib on purpose! */
 typedef struct carsym {
   char *name;
@@ -248,7 +244,8 @@ typedef struct carsym {
 } carsym;                      /* to make these you call a carsymogen */
 
   
-/* Used in generating armaps.  Perhaps just a forward definition would do? */
+/* Used in generating armaps (archive tables of contents).
+   Perhaps just a forward definition would do? */
 struct orl {                   /* output ranlib */
   char **name;                 /* symbol name */ 
   file_ptr pos;                        /* bfd* or file position */
@@ -261,7 +258,7 @@ struct orl {                        /* output ranlib */
 typedef struct lineno_cache_entry {
   unsigned int line_number;    /* Linenumber from start of function*/  
   union {
struct symbol_cache_entry *sym;               /* Function name */
   struct symbol_cache_entry *sym; /* Function name */
     unsigned long offset;      /* Offset into section */
   } u;
 } alent;
@@ -292,37 +289,6 @@ typedef struct sec *sec_ptr;
 
 typedef struct stat stat_type; 
 \f
-/* Error handling */
-
-typedef enum bfd_error
-{
-  no_error = 0,
-  system_call_error,
-  invalid_target,
-  wrong_format,
-  invalid_operation,
-  no_memory,
-  no_symbols,
-  no_relocation_info,
-  no_more_archived_files,
-  malformed_archive,
-  symbol_not_found,
-  file_not_recognized,
-  file_ambiguously_recognized,
-  no_contents,
-  bfd_error_nonrepresentable_section,
-  no_debug_section,
-  bad_value,
-  file_truncated,
-  invalid_error_code
-} bfd_ec;
-
-extern bfd_ec bfd_error;
-
-CONST char *bfd_errmsg PARAMS ((bfd_ec error_tag));
-void bfd_perror PARAMS ((CONST char *message));
-\f
-
 typedef enum bfd_print_symbol
 { 
   bfd_print_symbol_name,
@@ -330,13 +296,12 @@ typedef enum bfd_print_symbol
   bfd_print_symbol_all
 } bfd_print_symbol_type;
     
-\f
 /* Information about a symbol that nm needs.  */
 
 typedef struct _symbol_info
 {
   symvalue value;
-  char type;                   /*  */
+  char type;
   CONST char *name;            /* Symbol name.  */
   char stab_other;             /* Unused. */
   short stab_desc;             /* Info for N_TYPE.  */
@@ -424,11 +389,6 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
                                                    PTR),
                                       PTR info));
 \f
-/* The code that implements targets can initialize a jump table with this
-   macro.  It must name all its routines the same way (a prefix plus
-   the standard routine suffix), or it must #define the routines that
-   are not so named, before calling JUMP_TABLE in the initializer.  */
-
 /* Semi-portable string concatenation in cpp.
    The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
    The problem is, "32_" is not a valid preprocessing token, and we don't
@@ -454,44 +414,7 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
 #endif
 #endif
 
-#define JUMP_TABLE(NAME)\
-CAT(NAME,_core_file_failing_command),\
-CAT(NAME,_core_file_failing_signal),\
-CAT(NAME,_core_file_matches_executable_p),\
-CAT(NAME,_slurp_armap),\
-CAT(NAME,_slurp_extended_name_table),\
-CAT(NAME,_truncate_arname),\
-CAT(NAME,_write_armap),\
-CAT(NAME,_close_and_cleanup),\
-CAT(NAME,_set_section_contents),\
-CAT(NAME,_get_section_contents),\
-CAT(NAME,_new_section_hook),\
-CAT(NAME,_get_symtab_upper_bound),\
-CAT(NAME,_get_symtab),\
-CAT(NAME,_get_reloc_upper_bound),\
-CAT(NAME,_canonicalize_reloc),\
-CAT(NAME,_make_empty_symbol),\
-CAT(NAME,_print_symbol),\
-CAT(NAME,_get_symbol_info),\
-CAT(NAME,_get_lineno),\
-CAT(NAME,_set_arch_mach),\
-CAT(NAME,_openr_next_archived_file),\
-CAT(NAME,_find_nearest_line),\
-CAT(NAME,_generic_stat_arch_elt),\
-CAT(NAME,_sizeof_headers),\
-CAT(NAME,_bfd_debug_info_start),\
-CAT(NAME,_bfd_debug_info_end),\
-CAT(NAME,_bfd_debug_info_accumulate),\
-CAT(NAME,_bfd_get_relocated_section_contents),\
-CAT(NAME,_bfd_relax_section),\
-CAT(NAME,_bfd_reloc_type_lookup),\
-CAT(NAME,_bfd_make_debug_symbol),\
-CAT(NAME,_bfd_link_hash_table_create),\
-CAT(NAME,_bfd_link_add_symbols),\
-CAT(NAME,_bfd_final_link)
-
 #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
-
 \f
 /* User program access to BFD facilities */
 
@@ -547,16 +470,26 @@ struct ecoff_debug_info;
 struct ecoff_debug_swap;
 struct ecoff_extr;
 struct symbol_cache_entry;
+struct bfd_link_info;
 #endif
-extern boolean bfd_ecoff_debug_accumulate
+extern PTR bfd_ecoff_debug_init
   PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
+          const struct ecoff_debug_swap *output_swap,
+          struct bfd_link_info *));
+extern void bfd_ecoff_debug_free
+  PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
+          const struct ecoff_debug_swap *output_swap,
+          struct bfd_link_info *));
+extern boolean bfd_ecoff_debug_accumulate
+  PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
           const struct ecoff_debug_swap *output_swap,
           bfd *input_bfd, struct ecoff_debug_info *input_debug,
           const struct ecoff_debug_swap *input_swap,
-          boolean relocateable));
-extern boolean bfd_ecoff_debug_link_other
-  PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
-          const struct ecoff_debug_swap *output_swap, bfd *input_bfd));
+          struct bfd_link_info *));
+extern boolean bfd_ecoff_debug_accumulate_other
+  PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
+          const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
+          struct bfd_link_info *));
 extern boolean bfd_ecoff_debug_externals
   PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
           const struct ecoff_debug_swap *swap,
@@ -575,6 +508,10 @@ extern bfd_size_type bfd_ecoff_debug_size
 extern boolean bfd_ecoff_write_debug
   PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
           const struct ecoff_debug_swap *swap, file_ptr where));
+extern boolean bfd_ecoff_write_accumulated_debug
+  PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
+          const struct ecoff_debug_swap *swap,
+          struct bfd_link_info *info, file_ptr where));
 
 /* And more from the source.  */
 void 
@@ -679,7 +616,7 @@ bfd_create PARAMS ((CONST char *filename, bfd *templ));
 #define bfd_h_get_signed_64(abfd, ptr) \
                 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
 
-typedef struct sec 
+typedef struct sec
 {
          /* The name of the section; the name isn't a copy, the pointer is
         the same as that passed to bfd_make_section. */
@@ -688,7 +625,7 @@ typedef struct sec
 
          /* Which section is it; 0..nth.      */
 
-   int index;                      
+   int index;
 
          /* The next section in the list belonging to the BFD, or NULL. */
 
@@ -696,7 +633,7 @@ typedef struct sec
 
          /* The field flags contains attributes of the section. Some
            flags are read in from the object file, and some are
-           synthesized from other information.  */         
+           synthesized from other information.  */
 
     flagword flags;
 
@@ -706,7 +643,7 @@ typedef struct sec
            This is clear for a section containing debug information
            only. */
 #define SEC_ALLOC      0x001
-          
+
          /* Tells the OS to load the section from the file when loading.
            This is clear for a .bss section. */
 #define SEC_LOAD       0x002
@@ -777,6 +714,12 @@ typedef struct sec
            discarded. */
 #define SEC_DEBUGGING 0x10000
 
+         /* The contents of this section are held in memory pointed to
+           by the contents field.  This is checked by
+           bfd_get_section_contents, and the data is retrieved from
+           memory if appropriate.  */
+#define SEC_IN_MEMORY 0x20000
+
         /*  End of section flags.  */
 
         /*  The virtual memory address of the section - where it will be
@@ -799,13 +742,13 @@ typedef struct sec
            contains a value even if the section has no contents (e.g., the
            size of <<.bss>>). This will be filled in after relocation */
 
-   bfd_size_type _cooked_size;    
+   bfd_size_type _cooked_size;
 
          /* The original size on disk of the section, in bytes.  Normally this
            value is the same as the size, but if some relaxing has
            been done, then this value will be bigger.  */
 
-   bfd_size_type _raw_size;    
+   bfd_size_type _raw_size;
 
          /* If this section is going to be output, then this value is the
            offset into the output section of the first byte in the input
@@ -842,8 +785,8 @@ typedef struct sec
 
          /* File position of section data    */
 
-   file_ptr filepos;      
-        
+   file_ptr filepos;
+
          /* File position of relocation info */
 
    file_ptr rel_filepos;
@@ -856,12 +799,14 @@ typedef struct sec
 
    PTR userdata;
 
-   struct lang_output_section *otheruserdata;
+         /* If the SEC_IN_MEMORY flag is set, this points to the actual
+           contents.  */
+   unsigned char *contents;
 
          /* Attached line number information */
 
    alent *lineno;
-        
+
          /* Number of line number records   */
 
    unsigned int lineno_count;
@@ -888,7 +833,7 @@ typedef struct sec
 
    boolean reloc_done;
          /* A symbol which points at this section only */
-   struct symbol_cache_entry *symbol;  
+   struct symbol_cache_entry *symbol;
    struct symbol_cache_entry **symbol_ptr_ptr;
 
    struct bfd_link_order *link_order_head;
@@ -948,17 +893,23 @@ bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val));
 
 boolean 
 bfd_set_section_contents
- PARAMS ((bfd *abfd,        
+ PARAMS ((bfd *abfd,
     asection *section,
     PTR data,
     file_ptr offset,
     bfd_size_type count));
 
 boolean 
-bfd_get_section_contents 
+bfd_get_section_contents
  PARAMS ((bfd *abfd, asection *section, PTR location,
     file_ptr offset, bfd_size_type count));
 
+boolean 
+bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec));
+
+#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
+     BFD_SEND (ibfd, _bfd_copy_private_section_data, \
+               (ibfd, isection, obfd, osection))
 enum bfd_architecture 
 {
   bfd_arch_unknown,    /* File arch not known */
@@ -996,6 +947,7 @@ enum bfd_architecture
   bfd_arch_h8300,      /* Hitachi H8/300 */
 #define bfd_mach_h8300   1
 #define bfd_mach_h8300h  2
+  bfd_arch_powerpc,    /* PowerPC */
   bfd_arch_rs6000,     /* IBM RS/6000 */
   bfd_arch_hppa,       /* HP PA RISC */
   bfd_arch_z8k,        /* Zilog Z8000 */
@@ -1073,7 +1025,7 @@ CONST char *
 bfd_printable_arch_mach
  PARAMS ((enum bfd_architecture arch, unsigned long machine));
 
-typedef enum bfd_reloc_status 
+typedef enum bfd_reloc_status
 {
         /* No errors detected */
   bfd_reloc_ok,
@@ -1105,7 +1057,7 @@ typedef enum bfd_reloc_status
  bfd_reloc_status_type;
 
 
-typedef struct reloc_cache_entry 
+typedef struct reloc_cache_entry
 {
         /* A pointer into the canonical table of pointers  */
   struct symbol_cache_entry **sym_ptr_ptr;
@@ -1114,7 +1066,7 @@ typedef struct reloc_cache_entry
   bfd_size_type address;
 
         /* addend for relocation value */
-  bfd_vma addend;    
+  bfd_vma addend;
 
         /* Pointer to how to perform the required relocation */
   const struct reloc_howto_struct *howto;
@@ -1138,8 +1090,8 @@ enum complain_overflow
   complain_overflow_unsigned
 };
 
-typedef struct reloc_howto_struct 
-{ 
+typedef 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
            external idea of what a reloc number is stored
@@ -1179,12 +1131,12 @@ typedef struct reloc_howto_struct
           called rather than the normal function. This allows really
           strange relocation methods to be accomodated (e.g., i960 callj
           instructions). */
-  bfd_reloc_status_type (*special_function) 
+  bfd_reloc_status_type (*special_function)
                                    PARAMS ((bfd *abfd,
                                             arelent *reloc_entry,
                                             struct symbol_cache_entry *symbol,
                                             PTR data,
-                                            asection *input_section, 
+                                            asection *input_section,
                                             bfd *output_bfd,
                                             char **error_message));
 
@@ -1208,7 +1160,7 @@ typedef struct reloc_howto_struct
           into the instruction. In most cases src_mask == dst_mask,
           except in the above special case, where dst_mask would be
           0x000000ff, and src_mask would be 0x00000000.   */
-  bfd_vma dst_mask;           
+  bfd_vma dst_mask;
 
         /* When some formats create PC relative instructions, they leave
           the value of the pc of the place being relocated in the offset
@@ -1233,7 +1185,7 @@ typedef struct reloc_howto_struct
       relocation = symbol->value;              \
     }                                          \
   }                                            \
-}                      
+}
 int 
 bfd_get_reloc_size  PARAMS ((const reloc_howto_type *));
 
@@ -1253,12 +1205,14 @@ bfd_perform_relocation
     bfd *output_bfd,
     char **error_message));
 
-typedef enum bfd_reloc_code_real 
+typedef enum bfd_reloc_code_real
 {
    /* Basic absolute relocations */
   BFD_RELOC_64,
   BFD_RELOC_32,
-  BFD_RELOC_16,        
+  BFD_RELOC_26,
+  BFD_RELOC_16,
+  BFD_RELOC_14,
   BFD_RELOC_8,
 
    /* PC-relative relocations */
@@ -1283,6 +1237,10 @@ typedef enum bfd_reloc_code_real
    /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
      word displacement, e.g. for SPARC) */
   BFD_RELOC_32_PCREL_S2,
+   /* signed 16-bit pc-relative, shifted right 2 bits (e.g. for MIPS) */
+  BFD_RELOC_16_PCREL_S2,
+   /* this is used on the Alpha */
+  BFD_RELOC_23_PCREL_S2,
 
    /* High 22 bits of 32-bit value, placed into lower 22 bits of
      target word; simple reloc.  */
@@ -1290,6 +1248,13 @@ typedef enum bfd_reloc_code_real
    /* Low 10 bits.  */
   BFD_RELOC_LO10,
 
+   /* For systems that allocate a Global Pointer register, these are
+     displacements off that register.  These relocation types are
+     handled specially, because the value the register will have is
+     decided relatively late.  */
+  BFD_RELOC_GPREL16,
+  BFD_RELOC_GPREL32,
+
    /* Reloc types used for i960/b.out.  */
   BFD_RELOC_I960_CALLJ,
 
@@ -1331,13 +1296,50 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_SPARC_LO7,
    /* end-sanitize-v9 */
 
+   /* Alpha ECOFF relocations.  Some of these treat the symbol or "addend"
+     in some special way.  */
+   /* For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
+     writing; when reading, it will be the absolute section symbol.  The
+     addend is the displacement in bytes of the "lda" instruction from
+     the "ldah" instruction (which is at the address of this reloc).  */
+  BFD_RELOC_ALPHA_GPDISP_HI16,
+   /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
+     with GPDISP_HI16 relocs.  The addend is ignored when writing the
+     relocations out, and is filled in with the file's GP value on
+     reading, for convenience.  */
+  BFD_RELOC_ALPHA_GPDISP_LO16,
+
+   /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
+     the assembler turns it into a LDQ instruction to load the address of
+     the symbol, and then fills in a register in the real instruction.
+
+     The LITERAL reloc, at the LDQ instruction, refers to the .lita
+     section symbol.  The addend is ignored when writing, but is filled
+     in with the file's GP value on reading, for convenience, as with the
+     GPDISP_LO16 reloc.
+
+     The LITUSE reloc, on the instruction using the loaded address, gives
+     information to the linker that it might be able to use to optimize
+     away some literal section references.  The symbol is ignored (read
+     as the absolute section symbol), and the "addend" indicates the type
+     of instruction using the register:
+              1 - "memory" fmt insn
+              2 - byte-manipulation (byte offset reg)
+              3 - jsr (target of branch)
+
+     The GNU linker currently doesn't do any of this optimizing.  */
+  BFD_RELOC_ALPHA_LITERAL,
+  BFD_RELOC_ALPHA_LITUSE,
+
+   /* The HINT relocation indicates a value that should be filled into the
+     "hint" field of a jmp/jsr/ret instruction, for possible branch-
+     prediction logic which may be provided on some processors.  */
+  BFD_RELOC_ALPHA_HINT,
+
    /* Bits 27..2 of the relocation address shifted right 2 bits;
      simple reloc otherwise.  */
   BFD_RELOC_MIPS_JMP,
 
-   /* signed 16-bit pc-relative, shifted right 2 bits (e.g. for MIPS) */
-  BFD_RELOC_16_PCREL_S2,
-
    /* High 16 bits of 32-bit value; simple reloc.  */
   BFD_RELOC_HI16,
    /* High 16 bits of 32-bit value but the low 16 bits will be sign
@@ -1347,9 +1349,13 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_HI16_S,
    /* Low 16 bits.  */
   BFD_RELOC_LO16,
+   /* Like BFD_RELOC_HI16_S, but PC relative.  */
+  BFD_RELOC_PCREL_HI16_S,
+   /* Like BFD_RELOC_LO16, but PC relative.  */
+  BFD_RELOC_PCREL_LO16,
 
-   /* 16 bit relocation relative to the global pointer.  */
-  BFD_RELOC_MIPS_GPREL,
+   /* relocation relative to the global pointer.  */
+#define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16
 
    /* Relocation against a MIPS literal section.  */
   BFD_RELOC_MIPS_LITERAL,
@@ -1357,7 +1363,7 @@ typedef enum bfd_reloc_code_real
    /* MIPS ELF relocations.  */
   BFD_RELOC_MIPS_GOT16,
   BFD_RELOC_MIPS_CALL16,
-  BFD_RELOC_MIPS_GPREL32,
+#define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32
 
    /* These are, so far, specific to HPPA processors.  I'm not sure that some
      don't duplicate other reloc types, such as BFD_RELOC_32 and _32_PCREL.
@@ -1466,6 +1472,15 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_386_GOTOFF,
   BFD_RELOC_386_GOTPC,
 
+   /* 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.  */
+  BFD_RELOC_PPC_B26,
+   /* 26 bit absolute branch, like BFD_RELOC_PPC_B26 but absolute.  */
+  BFD_RELOC_PPC_BA26,
+   /* 16 bit TOC relative reference.  */
+  BFD_RELOC_PPC_TOC16,
+
    /* this must be the highest numeric value */
   BFD_RELOC_UNUSED
  } bfd_reloc_code_real_type;
@@ -1474,7 +1489,7 @@ const struct reloc_howto_struct *
 bfd_reloc_type_lookup  PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
 
 
-typedef struct symbol_cache_entry 
+typedef struct symbol_cache_entry
 {
         /* A pointer to the BFD which owns the symbol. This information
           is necessary so that a back end can work out what additional
@@ -1570,9 +1585,12 @@ typedef struct symbol_cache_entry
           for ELF STT_FILE symbols.  */
 #define BSF_FILE          0x4000
 
+        /* Symbol is from dynamic linking information.  */
+#define BSF_DYNAMIC       0x8000
+
   flagword flags;
 
-        /* A pointer to the section to which this symbol is 
+        /* A pointer to the section to which this symbol is
           relative.  This will always be non NULL, there are special
           sections for undefined and absolute symbols */
   struct sec *section;
@@ -1582,8 +1600,13 @@ typedef struct symbol_cache_entry
   PTR udata;
 
 } asymbol;
-#define get_symtab_upper_bound(abfd) \
-     BFD_SEND (abfd, _get_symtab_upper_bound, (abfd))
+#define bfd_get_symtab_upper_bound(abfd) \
+     BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
+boolean 
+bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
+
+#define bfd_is_local_label(abfd, sym) \
+     BFD_SEND (abfd, _bfd_is_local_label,(abfd, sym))
 #define bfd_canonicalize_symtab(abfd, location) \
      BFD_SEND (abfd, _bfd_canonicalize_symtab,\
                   (abfd, location))
@@ -1739,6 +1762,7 @@ struct _bfd
       struct sgi_core_struct *sgi_core_data;
       struct lynx_core_struct *lynx_core_data;
       struct osf_core_struct *osf_core_data;
+      struct cisco_core_struct *cisco_core_data;
       PTR any;
       } tdata;
   
@@ -1749,10 +1773,43 @@ struct _bfd
     struct obstack memory;
 };
 
-unsigned int 
+typedef enum bfd_error
+{
+  bfd_error_no_error = 0,
+  bfd_error_system_call,
+  bfd_error_invalid_target,
+  bfd_error_wrong_format,
+  bfd_error_invalid_operation,
+  bfd_error_no_memory,
+  bfd_error_no_symbols,
+  bfd_error_no_more_archived_files,
+  bfd_error_malformed_archive,
+  bfd_error_file_not_recognized,
+  bfd_error_file_ambiguously_recognized,
+  bfd_error_no_contents,
+  bfd_error_nonrepresentable_section,
+  bfd_error_no_debug_section,
+  bfd_error_bad_value,
+  bfd_error_file_truncated,
+  bfd_error_invalid_error_code
+} bfd_error_type;
+
+bfd_error_type 
+bfd_get_error  PARAMS ((void));
+
+void 
+bfd_set_error  PARAMS ((bfd_error_type error_tag));
+
+CONST char *
+bfd_errmsg  PARAMS ((bfd_error_type error_tag));
+
+void 
+bfd_perror  PARAMS ((CONST char *message));
+
+long 
 bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
 
-unsigned int 
+long 
 bfd_canonicalize_reloc
  PARAMS ((bfd *abfd,
     asection *sec,
@@ -1786,6 +1843,12 @@ bfd_set_gp_size PARAMS ((bfd *abfd, int i));
 bfd_vma 
 bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
 
+boolean 
+bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
+
+#define bfd_copy_private_bfd_data(ibfd, obfd) \
+     BFD_SEND (ibfd, _bfd_copy_private_bfd_data, \
+               (ibfd, obfd))
 #define bfd_sizeof_headers(abfd, reloc) \
      BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
 
@@ -1813,9 +1876,8 @@ bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
        BFD_SEND (abfd, _bfd_get_relocated_section_contents, \
                  (abfd, link_info, link_order, data, relocateable, symbols))
  
-#define bfd_relax_section(abfd, section, link_info, symbols) \
-       BFD_SEND (abfd, _bfd_relax_section, \
-                 (abfd, section, link_info, symbols))
+#define bfd_relax_section(abfd, section, link_info, again) \
+       BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
 
 #define bfd_link_hash_table_create(abfd) \
        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
@@ -1826,6 +1888,21 @@ bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
 #define bfd_final_link(abfd, info) \
        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
 
+#define bfd_free_cached_info(abfd) \
+       BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
+
+#define bfd_get_dynamic_symtab_upper_bound(abfd) \
+       BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
+
+#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
+       BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
+
+#define bfd_get_dynamic_reloc_upper_bound(abfd) \
+       BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
+
+#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
+       BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
+
 symindex 
 bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
 
@@ -1850,8 +1927,24 @@ core_file_matches_executable_p
 
 #define BFD_SEND(bfd, message, arglist) \
                ((*((bfd)->xvec->message)) arglist)
+
+#ifdef DEBUG_BFD_SEND
+#undef BFD_SEND
+#define BFD_SEND(bfd, message, arglist) \
+  (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
+    ((*((bfd)->xvec->message)) arglist) : \
+    (bfd_assert (__FILE__,__LINE__), NULL))
+#endif
 #define BFD_SEND_FMT(bfd, message, arglist) \
             (((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
+
+#ifdef DEBUG_BFD_SEND
+#undef BFD_SEND_FMT
+#define BFD_SEND_FMT(bfd, message, arglist) \
+  (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
+   (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \
+   (bfd_assert (__FILE__,__LINE__), NULL))
+#endif
 enum bfd_flavour {
   bfd_target_unknown_flavour,
   bfd_target_aout_flavour,
@@ -1863,7 +1956,8 @@ enum bfd_flavour {
   bfd_target_oasys_flavour,
   bfd_target_tekhex_flavour,
   bfd_target_srec_flavour,
-  bfd_target_som_flavour};
+  bfd_target_som_flavour,
+  bfd_target_os9k_flavour};
 
  /* Forward declaration.  */
 typedef struct bfd_link_info _bfd_link_info;
@@ -1901,9 +1995,52 @@ typedef struct bfd_target
   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 *));
+
+   /* Generic entry points.  */
+#define BFD_JUMP_TABLE_GENERIC(NAME)\
+CAT(NAME,_close_and_cleanup),\
+CAT(NAME,_bfd_free_cached_info),\
+CAT(NAME,_new_section_hook),\
+CAT(NAME,_get_section_contents)
+   /* Called when the BFD is being closed to do any necessary cleanup.  */
+  boolean       (*_close_and_cleanup) PARAMS ((bfd *));
+   /* Ask the BFD to free all cached information.  */
+  boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
+   /* Called when a new section is created.  */
+  boolean       (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
+   /* Read the contents of a section.  */
+  boolean       (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 
+                                            file_ptr, bfd_size_type));
+
+   /* Entry points to copy private data.  */
+#define BFD_JUMP_TABLE_COPY(NAME)\
+CAT(NAME,_bfd_copy_private_bfd_data),\
+CAT(NAME,_bfd_copy_private_section_data)
+   /* Called to copy BFD general private data from one object file
+     to another.  */
+  boolean       (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
+   /* Called to copy BFD private section data from one object file
+     to another.  */
+  boolean       (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
+                                                       bfd *, sec_ptr));
+
+   /* Core file entry points.  */
+#define BFD_JUMP_TABLE_CORE(NAME)\
+CAT(NAME,_core_file_failing_command),\
+CAT(NAME,_core_file_failing_signal),\
+CAT(NAME,_core_file_matches_executable_p)
   char *   (*_core_file_failing_command) PARAMS ((bfd *));
   int      (*_core_file_failing_signal) PARAMS ((bfd *));
   boolean  (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
+
+   /* Archive entry points.  */
+#define BFD_JUMP_TABLE_ARCHIVE(NAME)\
+CAT(NAME,_slurp_armap),\
+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)
   boolean  (*_bfd_slurp_armap) PARAMS ((bfd *));
   boolean  (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
   void     (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
@@ -1912,18 +2049,23 @@ typedef struct bfd_target
                               struct orl *map,
                               unsigned int orl_count, 
                               int stridx));
-  boolean       (*_close_and_cleanup) PARAMS ((bfd *));
-  boolean       (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
-                                            file_ptr, bfd_size_type));
-  boolean       (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 
-                                            file_ptr, bfd_size_type));
-  boolean       (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
-  unsigned int  (*_get_symtab_upper_bound) PARAMS ((bfd *));
-  unsigned int  (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
-                                              struct symbol_cache_entry **));
-  unsigned int  (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
-  unsigned int  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
-                                              struct symbol_cache_entry **));
+  bfd *      (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
+  int        (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
+   /* Entry points used for symbols.  */
+#define BFD_JUMP_TABLE_SYMBOLS(NAME)\
+CAT(NAME,_get_symtab_upper_bound),\
+CAT(NAME,_get_symtab),\
+CAT(NAME,_make_empty_symbol),\
+CAT(NAME,_print_symbol),\
+CAT(NAME,_get_symbol_info),\
+CAT(NAME,_bfd_is_local_label),\
+CAT(NAME,_get_lineno),\
+CAT(NAME,_find_nearest_line),\
+CAT(NAME,_bfd_make_debug_symbol)
+  long  (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
+  long  (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
+                                             struct symbol_cache_entry **));
   struct symbol_cache_entry  *
                 (*_bfd_make_empty_symbol) PARAMS ((bfd *));
   void          (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
@@ -1934,39 +2076,13 @@ typedef struct bfd_target
                                       struct symbol_cache_entry *,
                                       symbol_info *));
 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
-  alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
-
-  boolean    (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
-                    unsigned long));
+  boolean       (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *));
 
-  bfd *      (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
+  alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
   boolean    (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
                     struct sec *section, struct symbol_cache_entry **symbols,
                     bfd_vma offset, CONST char **file, CONST char **func,
                     unsigned int *line));
-  int        (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
-
-  int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
-
-  void       (*_bfd_debug_info_start) PARAMS ((bfd *));
-  void       (*_bfd_debug_info_end) PARAMS ((bfd *));
-  void       (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *));
-
-  bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
-                    struct bfd_link_info *, struct bfd_link_order *,
-                    bfd_byte *data, boolean relocateable,
-                    struct symbol_cache_entry **));
-
-  boolean    (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
-                    struct bfd_link_info *, struct symbol_cache_entry **));
-
-  /* See documentation on reloc types.  */
- CONST struct reloc_howto_struct *
-       (*reloc_type_lookup) PARAMS ((bfd *abfd,
-                                     bfd_reloc_code_real_type code));
-
   /* Back-door to allow format-aware applications to create debug symbols
     while using BFD for everything else.  Currently used by the assembler
     when creating COFF files.  */
@@ -1975,16 +2091,72 @@ typedef struct bfd_target
        void *ptr,
        unsigned long size));
 
-  /* Create a hash table for the linker.  Different backends store
-    different information in this table.  */
- struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
+   /* Routines for relocs.  */
+#define BFD_JUMP_TABLE_RELOCS(NAME)\
+CAT(NAME,_get_reloc_upper_bound),\
+CAT(NAME,_canonicalize_reloc),\
+CAT(NAME,_bfd_reloc_type_lookup)
+  long  (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
+  long  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
+                                            struct symbol_cache_entry **));
+   /* See documentation on reloc types.  */
+  CONST struct reloc_howto_struct *
+       (*reloc_type_lookup) PARAMS ((bfd *abfd,
+                                     bfd_reloc_code_real_type code));
+
+   /* Routines used when writing an object file.  */
+#define BFD_JUMP_TABLE_WRITE(NAME)\
+CAT(NAME,_set_arch_mach),\
+CAT(NAME,_set_section_contents)
+  boolean    (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
+                    unsigned long));
+  boolean       (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
+                                            file_ptr, bfd_size_type));
 
-  /* Add symbols from this object file into the hash table.  */
- boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
+   /* Routines used by the linker.  */
+#define BFD_JUMP_TABLE_LINK(NAME)\
+CAT(NAME,_sizeof_headers),\
+CAT(NAME,_bfd_get_relocated_section_contents),\
+CAT(NAME,_bfd_relax_section),\
+CAT(NAME,_bfd_link_hash_table_create),\
+CAT(NAME,_bfd_link_add_symbols),\
+CAT(NAME,_bfd_final_link)
+  int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
+  bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
+                    struct bfd_link_info *, struct bfd_link_order *,
+                    bfd_byte *data, boolean relocateable,
+                    struct symbol_cache_entry **));
 
-  /* Do a link based on the link_order structures attached to each
-    section of the BFD.  */
- boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
+  boolean    (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
+                    struct bfd_link_info *, boolean *again));
+
+   /* Create a hash table for the linker.  Different backends store
+     different information in this table.  */
+  struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
+
+   /* Add symbols from this object file into the hash table.  */
+  boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
+
+   /* Do a link based on the link_order structures attached to each
+     section of the BFD.  */
+  boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
+
+  /* Routines to handle dynamic symbols and relocs.  */
+#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
+CAT(NAME,_get_dynamic_symtab_upper_bound),\
+CAT(NAME,_canonicalize_dynamic_symtab),\
+CAT(NAME,_get_dynamic_reloc_upper_bound),\
+CAT(NAME,_canonicalize_dynamic_reloc)
+   /* Get the amount of memory required to hold the dynamic symbols. */
+  long  (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
+   /* Read in the dynamic symbols.  */
+  long  (*_bfd_canonicalize_dynamic_symtab)
+    PARAMS ((bfd *, struct symbol_cache_entry **));
+   /* Get the amount of memory required to hold the dynamic relocs.  */
+  long  (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
+   /* Read in the dynamic relocs.  */
+  long  (*_bfd_canonicalize_dynamic_reloc)
+    PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
 
  PTR backend_data;
 } bfd_target;
@@ -1997,6 +2169,9 @@ bfd_target_list PARAMS ((void));
 boolean 
 bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
 
+boolean 
+bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
+
 boolean 
 bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
 
This page took 0.049909 seconds and 4 git commands to generate.