Switched over to using new reloc types.
[deliverable/binutils-gdb.git] / bfd / bfd-in2.h
index f4c273f02ed8dd66d3557e5728935ff807eedd92..aba89edc96df93c7767023ec04d4668610a9e486 100644 (file)
@@ -1,5 +1,5 @@
 /* Main header file for the bfd library -- portable access to object files.
-   Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 ** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
@@ -49,7 +49,6 @@ extern "C" {
 #endif
 
 #include "ansidecl.h"
-#include "obstack.h"
 
 /* These two lines get substitutions done by commands in Makefile.in.  */
 #define BFD_VERSION  "@VERSION@"
@@ -310,6 +309,7 @@ typedef struct sec *sec_ptr;
 #define bfd_section_name(bfd, ptr) ((ptr)->name)
 #define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
 #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
+#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
 #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
 #define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
 #define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
@@ -380,8 +380,9 @@ struct bfd_hash_table
   struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
                                             struct bfd_hash_table *,
                                             const char *));
-  /* An obstack for this hash table.  */
-  struct obstack memory;
+   /* An objalloc for this hash table.  This is a struct objalloc *,
+     but we use PTR to avoid requiring the inclusion of objalloc.h.  */
+  PTR memory;
 };
 
 /* Initialize a hash table.  */
@@ -539,6 +540,7 @@ struct ecoff_extr;
 struct symbol_cache_entry;
 struct bfd_link_info;
 struct bfd_link_hash_entry;
+struct bfd_elf_version_tree;
 #endif
 extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd));
 extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value));
@@ -605,11 +607,13 @@ extern boolean bfd_elf64_record_link_assignment
 extern struct bfd_link_needed_list *bfd_elf_get_needed_list
   PARAMS ((bfd *, struct bfd_link_info *));
 extern boolean bfd_elf32_size_dynamic_sections
-  PARAMS ((bfd *, const char *, const char *, boolean,
-          struct bfd_link_info *, struct sec **));
+  PARAMS ((bfd *, const char *, const char *, boolean, const char *,
+          const char * const *, struct bfd_link_info *, struct sec **,
+          struct bfd_elf_version_tree *));
 extern boolean bfd_elf64_size_dynamic_sections
-  PARAMS ((bfd *, const char *, const char *, boolean,
-          struct bfd_link_info *, struct sec **));
+  PARAMS ((bfd *, const char *, const char *, boolean, const char *,
+          const char * const *, struct bfd_link_info *, struct sec **,
+          struct bfd_elf_version_tree *));
 extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
 extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
 
@@ -629,6 +633,8 @@ extern boolean bfd_i386linux_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 extern boolean bfd_m68klinux_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_sparclinux_size_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
 
 /* mmap hacks */
 
@@ -696,7 +702,7 @@ bfd *
 bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
 
 bfd *
-bfd_openstreamr PARAMS (());
+bfd_openstreamr PARAMS ((const char *, const char *, PTR));
 
 bfd *
 bfd_openw PARAMS ((CONST char *filename, CONST char *target));
@@ -707,9 +713,6 @@ bfd_close PARAMS ((bfd *abfd));
 boolean 
 bfd_close_all_done PARAMS ((bfd *));
 
-bfd_size_type 
-bfd_alloc_size PARAMS ((bfd *abfd));
-
 bfd *
 bfd_create PARAMS ((CONST char *filename, bfd *templ));
 
@@ -939,6 +942,12 @@ typedef struct sec
           contents.  */
 #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
 
+        /* This section was created by the linker as part of dynamic
+          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 0x800000
+
         /*  End of section flags.  */
 
         /* Some internal packed boolean fields.  */
@@ -1146,7 +1155,7 @@ 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, \
+     BFD_SEND (obfd, _bfd_copy_private_section_data, \
                (ibfd, isection, obfd, osection))
 enum bfd_architecture 
 {
@@ -1204,25 +1213,49 @@ enum bfd_architecture
   bfd_arch_powerpc,    /* PowerPC */
   bfd_arch_rs6000,     /* IBM RS/6000 */
   bfd_arch_hppa,       /* HP PA RISC */
-  /* start-sanitize-d10v */
   bfd_arch_d10v,       /* Mitsubishi D10V */
-  /* end-sanitize-d10v */
+  /* start-sanitize-d30v */
+  bfd_arch_d30v,       /* Mitsubishi D30V */
+  /* end-sanitize-d30v */
   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 */
+#define bfd_mach_sh            0
+#define bfd_mach_sh3        0x30
+#define bfd_mach_sh3e       0x3e
+   /* start-sanitize-sh4 */
+#define bfd_mach_sh4        0x40
+   /* end-sanitize-sh4 */
   bfd_arch_alpha,      /* Dec Alpha */
   bfd_arch_arm,        /* Advanced Risc Machines ARM */
+#define bfd_mach_arm_2         1
+#define bfd_mach_arm_2a                2
+#define bfd_mach_arm_3         3
+#define bfd_mach_arm_3M        4
+#define bfd_mach_arm_4                 5
+#define bfd_mach_arm_4T        6
   bfd_arch_ns32k,      /* National Semiconductors ns32000 */
   bfd_arch_w65,        /* WDC 65816 */
-  /* start-sanitize-arc */
+  /* start-sanitize-tic80 */
+  bfd_arch_tic80,      /* TI TMS320c80 (MVP) */
+  /* end-sanitize-tic80 */
+  /* start-sanitize-v850 */
+  bfd_arch_v850,       /* NEC V850 */
+#define bfd_mach_v850          0
+  /* start-sanitize-v850e */
+#define bfd_mach_v850e         'E'
+  /* end-sanitize-v850e */
+  /* start-sanitize-v850eq */
+#define bfd_mach_v850eq        'Q'
+  /* end-sanitize-v850eq */
+  /* end-sanitize-v850 */
   bfd_arch_arc,        /* Argonaut RISC Core */
 #define bfd_mach_arc_base 0
-#define bfd_mach_arc_host 1
-#define bfd_mach_arc_graphics 2
-#define bfd_mach_arc_audio 3
-  /* end-sanitize-arc */
+  bfd_arch_m32r,       /* Mitsubishi M32R/D */
+  bfd_arch_mn10200,    /* Matsushita MN10200 */
+  bfd_arch_mn10300,    /* Matsushita MN10300 */
   bfd_arch_last
   };
 
@@ -1352,7 +1385,7 @@ enum complain_overflow
 
 struct reloc_howto_struct
 {
-        /*  The type field has mainly a documetary use - the back end can
+        /*  The type field has mainly a documentary 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
            in this field. For example, a PC relative word relocation
@@ -1480,6 +1513,7 @@ enum bfd_reloc_code_real {
   BFD_RELOC_64,
   BFD_RELOC_32,
   BFD_RELOC_26,
+  BFD_RELOC_24,
   BFD_RELOC_16,
   BFD_RELOC_14,
   BFD_RELOC_8,
@@ -1627,6 +1661,12 @@ 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 ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
+It should refer to the symbol to be referenced, as with 16_GOTOFF,
+but it generates output not based on the position within the .got
+section, but relative to the GP value chosen for the file during the
+final link stage.
+
 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
@@ -1638,6 +1678,7 @@ of instruction using the register:
 
 The GNU linker currently doesn't do any of this optimizing. */
   BFD_RELOC_ALPHA_LITERAL,
+  BFD_RELOC_ALPHA_ELF_LITERAL,
   BFD_RELOC_ALPHA_LITUSE,
 
 /* The HINT relocation indicates a value that should be filled into the
@@ -1649,10 +1690,20 @@ prediction logic which may be provided on some processors. */
 which is filled by the linker. */
   BFD_RELOC_ALPHA_LINKAGE,
 
+/* The CODEADDR relocation outputs a STO_CA in the object file,
+which is filled by the linker. */
+  BFD_RELOC_ALPHA_CODEADDR,
+
 /* Bits 27..2 of the relocation address shifted right 2 bits;
 simple reloc otherwise. */
   BFD_RELOC_MIPS_JMP,
 
+/* The MIPS16 jump instruction. */
+  BFD_RELOC_MIPS16_JMP,
+
+/* MIPS16 GP relative reloc. */
+  BFD_RELOC_MIPS16_GPREL,
+
 /* High 16 bits of 32-bit value; simple reloc. */
   BFD_RELOC_HI16,
 
@@ -1765,7 +1816,36 @@ not stored in the instruction. */
   BFD_RELOC_ARM_IN_POOL,
   BFD_RELOC_ARM_OFFSET_IMM8,
   BFD_RELOC_ARM_HWLITERAL,
-/* start-sanitize-arc */
+  BFD_RELOC_ARM_THUMB_ADD,
+  BFD_RELOC_ARM_THUMB_IMM,
+  BFD_RELOC_ARM_THUMB_SHIFT,
+  BFD_RELOC_ARM_THUMB_OFFSET,
+
+/* Hitachi SH relocs.  Not all of these appear in object files. */
+  BFD_RELOC_SH_PCDISP8BY2,
+  BFD_RELOC_SH_PCDISP12BY2,
+  BFD_RELOC_SH_IMM4,
+  BFD_RELOC_SH_IMM4BY2,
+  BFD_RELOC_SH_IMM4BY4,
+  BFD_RELOC_SH_IMM8,
+  BFD_RELOC_SH_IMM8BY2,
+  BFD_RELOC_SH_IMM8BY4,
+  BFD_RELOC_SH_PCRELIMM8BY2,
+  BFD_RELOC_SH_PCRELIMM8BY4,
+  BFD_RELOC_SH_SWITCH16,
+  BFD_RELOC_SH_SWITCH32,
+  BFD_RELOC_SH_USES,
+  BFD_RELOC_SH_COUNT,
+  BFD_RELOC_SH_ALIGN,
+  BFD_RELOC_SH_CODE,
+  BFD_RELOC_SH_DATA,
+  BFD_RELOC_SH_LABEL,
+
+/* Thumb 23-, 12- and 9-bit pc-relative branches.  The lowest bit must
+be zero and is not stored in the instruction. */
+  BFD_RELOC_THUMB_PCREL_BRANCH9,
+  BFD_RELOC_THUMB_PCREL_BRANCH12,
+  BFD_RELOC_THUMB_PCREL_BRANCH23,
 
 /* Argonaut RISC Core (ARC) relocs.
 ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
@@ -1777,9 +1857,6 @@ through 7 of the instruction. */
 stored in the instruction.  The high 24 bits are installed in bits 23
 through 0. */
   BFD_RELOC_ARC_B26,
-/* end-sanitize-arc */
-
-/* start-sanitize-d10v */
 
 /* Mitsubishi D10V relocs.
 This is a 10-bit reloc with the right 2 bits
@@ -1800,8 +1877,100 @@ assumed to be 0. */
 /* This is an 18-bit reloc with the right 2 bits
 assumed to be 0. */
   BFD_RELOC_D10V_18_PCREL,
-/* end-sanitize-d10v */
 
+/* start-sanitize-d30v */
+
+/* Mitsubishi D30V relocs.
+This is a 6-bit absolute reloc. */
+  BFD_RELOC_D30V_6,
+
+/* Mitsubishi D30V relocs.
+This is a 12-bit absolute reloc with the 
+right 3 bitsassumed to be 0. */
+  BFD_RELOC_D30V_15,
+
+/* Mitsubishi D30V relocs.
+This is a 12-bit pc-relative reloc with 
+the right 3 bits assumed to be 0. */
+  BFD_RELOC_D30V_15_PCREL,
+
+/* This is an 18-bit absolute reloc with 
+the right 3 bits assumed to be 0. */
+  BFD_RELOC_D30V_21,
+
+/* This is an 18-bit pc-relative reloc with 
+the right 3 bits assumed to be 0. */
+  BFD_RELOC_D30V_21_PCREL,
+
+/* This is a 32-bit absolute reloc. */
+  BFD_RELOC_D30V_32,
+
+/* This is a 32-bit pc-relative reloc. */
+  BFD_RELOC_D30V_32_PCREL,
+/* end-sanitize-d30v */
+
+
+/* Mitsubishi M32R relocs.
+This is a 24 bit absolute address. */
+  BFD_RELOC_M32R_24,
+
+/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
+  BFD_RELOC_M32R_10_PCREL,
+
+/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
+  BFD_RELOC_M32R_18_PCREL,
+
+/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
+  BFD_RELOC_M32R_26_PCREL,
+
+/* This is a 16-bit reloc containing the high 16 bits of an address
+used when the lower 16 bits are treated as unsigned. */
+  BFD_RELOC_M32R_HI16_ULO,
+
+/* This is a 16-bit reloc containing the high 16 bits of an address
+used when the lower 16 bits are treated as signed. */
+  BFD_RELOC_M32R_HI16_SLO,
+
+/* This is a 16-bit reloc containing the lower 16 bits of an address. */
+  BFD_RELOC_M32R_LO16,
+
+/* This is a 16-bit reloc containing the small data area offset for use in
+add3, load, and store instructions. */
+  BFD_RELOC_M32R_SDA16,
+/* start-sanitize-v850 */
+
+/* This is a 9-bit reloc */
+  BFD_RELOC_V850_9_PCREL,
+
+/* This is a 16-bit reloc */
+  BFD_RELOC_V850_16_PCREL,
+
+/* This is a 22-bit reloc */
+  BFD_RELOC_V850_22_PCREL,
+
+  BFD_RELOC_V850_SDA_16_16_OFFSET,             /* A 16 bit reloc in the small data area.  */
+  BFD_RELOC_V850_SDA_15_16_OFFSET,             /* A 16 bit reloc (of which only 15 bits are used) in the small data area.  */
+  BFD_RELOC_V850_ZDA_16_16_OFFSET,             /* A 16 bit reloc in the zero data area.  */
+  BFD_RELOC_V850_ZDA_15_16_OFFSET,             /* A 16 bit reloc (of which only 15 bits are used) in the zero data area.  */
+  BFD_RELOC_V850_TDA_6_8_OFFSET,               /* An 8 bit reloc (of which only 6 bits are used) in the tiny data area.  */
+  BFD_RELOC_V850_TDA_7_8_OFFSET,               /* An 8 bit reloc (of which only 7 bits are used) in the tiny data area.  */
+  BFD_RELOC_V850_TDA_7_7_OFFSET,               /* A  7 bit reloc in the tiny data area.  */
+/* start-sanitize-v850e */
+  BFD_RELOC_V850_TDA_4_5_OFFSET,               /* A  5 bit reloc (of which only 4 bits are used) in the tiny data area.  */
+  BFD_RELOC_V850_TDA_4_4_OFFSET,               /* A  4 bit reloc in the tiny data area.  */
+  BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,       /* A 16 bit reloc (but the bits are not contiguous) in the small data area.  */
+  BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,       /* A 16 bit reloc (but the bits are not contiguous) in the zero data area.  */
+/* end-santize-v850e */
+/* end-sanitize-v850 */
+
+
+/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
+instruction. */
+  BFD_RELOC_MN10300_32_PCREL,
+
+/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
+instruction. */
+  BFD_RELOC_MN10300_16_PCREL,
   BFD_RELOC_UNUSED };
 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
 reloc_howto_type *
@@ -1934,8 +2103,11 @@ typedef struct symbol_cache_entry
 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))
+boolean 
+bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name));
+
+#define bfd_is_local_label_name(abfd, name) \
+     BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
 #define bfd_canonicalize_symtab(abfd, location) \
      BFD_SEND (abfd, _bfd_canonicalize_symtab,\
                   (abfd, location))
@@ -1959,7 +2131,7 @@ boolean
 bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym));
 
 #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
-     BFD_SEND (ibfd, _bfd_copy_private_symbol_data, \
+     BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
                (ibfd, isymbol, obfd, osymbol))
 struct _bfd 
 {
@@ -2111,8 +2283,10 @@ struct _bfd
      /* Used by the application to hold private data*/
     PTR usrdata;
 
-     /* Where all the allocated stuff under this BFD goes */
-    struct obstack memory;
+   /* Where all the allocated stuff under this BFD goes.  This is a
+     struct objalloc *, but we use PTR to avoid requiring the inclusion of
+     objalloc.h.  */
+    PTR memory;
 };
 
 typedef enum bfd_error
@@ -2199,13 +2373,13 @@ 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, \
+     BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
                (ibfd, obfd))
 boolean 
 bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 
 #define bfd_merge_private_bfd_data(ibfd, obfd) \
-     BFD_SEND (ibfd, _bfd_merge_private_bfd_data, \
+     BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
                (ibfd, obfd))
 boolean 
 bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
@@ -2464,7 +2638,7 @@ 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,_bfd_is_local_label_name),\
 CAT(NAME,_get_lineno),\
 CAT(NAME,_find_nearest_line),\
 CAT(NAME,_bfd_make_debug_symbol),\
@@ -2483,7 +2657,7 @@ CAT(NAME,_minisymbol_to_symbol)
                                       struct symbol_cache_entry *,
                                       symbol_info *));
 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
-  boolean       (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *));
+  boolean       (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
 
   alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
   boolean    (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
@@ -2579,6 +2753,9 @@ CAT(NAME,_canonicalize_dynamic_reloc)
 
  PTR backend_data;
 } bfd_target;
+boolean 
+bfd_set_default_target  PARAMS ((const char *name));
+
 const bfd_target *
 bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd));
 
This page took 0.029657 seconds and 4 git commands to generate.