]> Git Repo - binutils.git/blobdiff - bfd/bfd-in2.h
Don't let netbsd386.c get sanitized out.
[binutils.git] / bfd / bfd-in2.h
index b57d013c6b85d8efb37a0535659cd3ddd02c9293..f9ea793dae77aa95732e3b6959d1da5454995a19 100644 (file)
@@ -1,9 +1,11 @@
 /* Main header file for the bfd library -- portable access to object files.
-   ==> The bfd.h file is generated from bfd-in.h and various .c files; if you
-   ==> change it, your changes will probably be lost.
    Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
+** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
+** instead, change bfd-in.h or the other BFD source files processed to
+** generate these files.
+
 This file is part of BFD, the Binary File Descriptor library.
 
 This program is free software; you can redistribute it and/or modify
@@ -53,6 +55,14 @@ here.  */
 #define BFD64
 #endif
 
+#ifndef INLINE
+#if __GNUC__ >= 2
+#define INLINE __inline__
+#else
+#define INLINE
+#endif
+#endif
+
 /* 64-bit type definition (if any) from bfd's sysdep.h goes here */
 
 
@@ -101,12 +111,21 @@ typedef HOST_64_BIT int64_type;
 typedef unsigned HOST_64_BIT uint64_type;
 #endif
 
+#if !defined (uint64_type) && defined (__GNUC__)
+#define uint64_type unsigned long long
+#define int64_type long long
+#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;
 #define fprintf_vma(s,x) \
                fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
+#define sprintf_vma(s,x) \
+               sprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
 #else /* not BFD64  */
 
 /* Represent a target address.  Also used as a generic unsigned type
@@ -125,6 +144,7 @@ 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)
 #endif /* not BFD64  */
 #define printf_vma(x) fprintf_vma(stdout,x)
 
@@ -301,14 +321,28 @@ typedef struct _symbol_info
    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 */
+/* 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
+   want extra underscores (e.g., "nlm_32_").  The XCAT2 macro will cause the
+   inner CAT macros to be evaluated first, producing still-valid pp-tokens.
+   Then the final concatenation can be done.  (Sigh.)  */
 #ifndef CAT
+#ifdef SABER
+#define CAT(a,b)       a##b
+#define CAT3(a,b,c)    a##b##c
+#define CAT4(a,b,c,d)  a##b##c##d
+#else
 #ifdef __STDC__
 #define CAT(a,b) a##b
 #define CAT3(a,b,c) a##b##c
+#define XCAT2(a,b)     CAT(a,b)
+#define CAT4(a,b,c,d)  XCAT2(CAT(a,b),CAT(c,d))
 #else
 #define CAT(a,b) a/**/b
 #define CAT3(a,b,c) a/**/b/**/c
+#define CAT4(a,b,c,d)  a/**/b/**/c/**/d
+#endif
 #endif
 #endif
 
@@ -320,7 +354,7 @@ 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,_close_and_cleanup),\
 CAT(NAME,_set_section_contents),\
 CAT(NAME,_get_section_contents),\
 CAT(NAME,_new_section_hook),\
@@ -409,7 +443,7 @@ bfd_size_type
 bfd_alloc_size PARAMS ((bfd *abfd));
 
 bfd *
-bfd_create PARAMS ((CONST char *filename, bfd *template));
+bfd_create PARAMS ((CONST char *filename, bfd *templ));
 
 
  /* Byte swapping macros for user section data.  */
@@ -496,7 +530,6 @@ typedef struct sec
 
     CONST char *name;
 
-
          /* Which section is it 0.nth      */
 
    int index;                      
@@ -516,13 +549,14 @@ typedef struct sec
          /* Tells the OS to allocate space for this section when loaded.
            This would 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 would be clear for a .bss section */
 
 #define SEC_LOAD       0x002
+
          /* The section contains data still to be relocated, so there will
            be some relocation information too. */
 
@@ -534,6 +568,7 @@ typedef struct sec
 
          /* A signal to the OS that the section contains read only
           data. */
+
 #define SEC_READONLY   0x010
 
          /* The section contains code only. */
@@ -565,9 +600,7 @@ typedef struct sec
           end of the . */
 
 #define SEC_CONSTRUCTOR_TEXT 0x1100
-
 #define SEC_CONSTRUCTOR_DATA 0x2100
-
 #define SEC_CONSTRUCTOR_BSS  0x3100
 
          /* The section has contents - a data section could be
@@ -598,10 +631,12 @@ typedef struct sec
 
         /*  The virtual memory address of the section - where it will be
            at run time - the symbols are relocated against this */
+
    bfd_vma vma;
 
         /*  The load address of the section - where it would be in a
            rom image, really only used for writing section header information */
+
    bfd_vma lma;
 
    boolean user_set_vma;
@@ -649,9 +684,9 @@ typedef struct sec
    unsigned reloc_count;
 
          /* Information below is back end specific - and not always used
-           or updated 
+           or updated.  */
 
-           File position of section data    */
+         /* File position of section data    */
 
    file_ptr filepos;      
         
@@ -701,6 +736,7 @@ typedef struct sec
          /* A symbol which points at this section only */
    struct symbol_cache_entry *symbol;  
    struct symbol_cache_entry **symbol_ptr_ptr;
+
    struct bfd_seclet *seclets_head;
    struct bfd_seclet *seclets_tail;
 } asection ;
@@ -712,18 +748,18 @@ typedef struct sec
 #define BFD_IND_SECTION_NAME "*IND*"
 
      /* the absolute section */
- extern   asection bfd_abs_section;
+extern asection bfd_abs_section;
      /* Pointer to the undefined section */
- extern   asection bfd_und_section;
+extern asection bfd_und_section;
      /* Pointer to the common section */
- extern asection bfd_com_section;
+extern asection bfd_com_section;
      /* Pointer to the indirect section */
- extern asection bfd_ind_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 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;
 #define bfd_get_section_size_before_reloc(section) \
      (section->reloc_done ? (abort(),1): (section)->_raw_size)
 #define bfd_get_section_size_after_reloc(section) \
@@ -923,6 +959,23 @@ typedef struct reloc_cache_entry
   CONST struct reloc_howto_struct *howto;
 
 } arelent;
+enum complain_overflow
+{
+        /* Do not complain on overflow. */
+  complain_overflow_dont,
+
+        /* Complain if the bitfield overflows, whether it is considered
+          as signed or unsigned. */
+  complain_overflow_bitfield,
+
+        /* Complain if the value overflows when considered as signed
+          number. */
+  complain_overflow_signed,
+
+        /* Complain if the value overflows when considered as an
+          unsigned number. */
+  complain_overflow_unsigned
+};
 
 typedef CONST struct reloc_howto_struct 
 { 
@@ -943,7 +996,8 @@ typedef CONST struct reloc_howto_struct
            result is to be subtracted from the data.  */
   int size;
 
-        /*  Now obsolete?  But m68k-coff still uses it... */
+        /*  The number of bits in the item to be relocated.  This is used
+           when doing overflow checking.  */
   unsigned int bitsize;
 
         /*  Notes that the relocation is relative to the location in the
@@ -952,14 +1006,13 @@ typedef CONST struct reloc_howto_struct
            being relocated. */
   boolean pc_relative;
 
+        /*  The bit position of the reloc value in the destination.
+           The relocated value is left shifted by this amount. */
   unsigned int bitpos;
 
-        /*  Now obsolete */
-  boolean absolute;
-
-        /* Causes the relocation routine to return an error if overflow
-          is detected when relocating. */
-  boolean complain_on_overflow;
+        /* What type of overflow error should be checked for when
+          relocating. */
+  enum complain_overflow complain_on_overflow;
 
         /* If this field is non null, then the supplied function is
           called rather than the normal function. This allows really
@@ -1004,9 +1057,9 @@ typedef CONST struct reloc_howto_struct
   boolean pcrel_offset;
 
 } reloc_howto_type;
-#define HOWTO(C, R,S,B, P, BI, ABS, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
-  {(unsigned)C,R,S,B, P, BI, ABS,O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
-#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,false,false,FUNCTION, NAME,false,0,0,IN)
+#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)
 
 #define HOWTO_PREPARE(relocation, symbol)      \
   {                                            \
@@ -1037,41 +1090,43 @@ bfd_perform_relocation
 typedef enum bfd_reloc_code_real 
 
 {
-        /* 16 bits wide, simple reloc */
-  BFD_RELOC_16,        
+   /* 64 bits wide, simple reloc */
+  BFD_RELOC_64,
+   /* 64 bits, PC-relative */
+  BFD_RELOC_64_PCREL,
 
-        /* 8 bits wide, but used to form an address like 0xffnn */
-  BFD_RELOC_8_FFnn,
+   /* 32 bits wide, simple reloc */
+  BFD_RELOC_32,
+   /* 32 bits, PC-relative */
+  BFD_RELOC_32_PCREL,
 
-        /* 8 bits wide, simple */
-  BFD_RELOC_8,
+   /* 16 bits wide, simple reloc */
+  BFD_RELOC_16,        
+   /* 16 bits, PC-relative */
+  BFD_RELOC_16_PCREL,
 
-        /* 8 bits wide, pc relative */
+   /* 8 bits wide, simple */
+  BFD_RELOC_8,
+   /* 8 bits wide, pc relative */
   BFD_RELOC_8_PCREL,
+   /* 8 bits wide, but used to form an address like 0xffnn */
+  BFD_RELOC_8_FFnn,
 
-        /* The type of reloc used to build a contructor table - at the
-          moment probably a 32 bit wide abs address, but the cpu can
-          choose. */
-
+   /* The type of reloc used to build a contructor table - at the moment
+     probably a 32 bit wide abs address, but the cpu can choose. */
   BFD_RELOC_CTOR,
 
-        /* 32 bits wide, simple reloc */
-  BFD_RELOC_32,
-        /* 32 bits, PC-relative */
-  BFD_RELOC_32_PCREL,
-
-        /* High 22 bits of 32-bit value; simple reloc.  */
+   /* High 22 bits of 32-bit value; simple reloc.  */
   BFD_RELOC_HI22,
-        /* Low 10 bits.  */
+   /* Low 10 bits.  */
   BFD_RELOC_LO10,
 
-        /* Reloc types used for i960/b.out.  */
+   /* Reloc types used for i960/b.out.  */
   BFD_RELOC_24_PCREL,
   BFD_RELOC_I960_CALLJ,
 
-  BFD_RELOC_16_PCREL,
-        /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
-          word displacement, e.g. for SPARC) */
+   /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
+     word displacement, e.g. for SPARC) */
   BFD_RELOC_32_PCREL_S2,
 
    /* now for the sparc/elf codes */
@@ -1079,7 +1134,6 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_SPARC_WDISP22,
   BFD_RELOC_SPARC22,
   BFD_RELOC_SPARC13,
-  BFD_RELOC_SPARC_BASE13,
   BFD_RELOC_SPARC_GOT10,
   BFD_RELOC_SPARC_GOT13,
   BFD_RELOC_SPARC_GOT22,
@@ -1092,40 +1146,58 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_SPARC_RELATIVE,
   BFD_RELOC_SPARC_UA32,
 
-   /* this one is a.out specific? */
+   /* these are a.out specific? */
+  BFD_RELOC_SPARC_BASE13,
   BFD_RELOC_SPARC_BASE22,
 
-        /* Bits 27..2 of the relocation address shifted right 2 bits;
-         simple reloc otherwise.  */
+   /* start-sanitize-v9 */
+  BFD_RELOC_SPARC_10,
+  BFD_RELOC_SPARC_11,
+#define  BFD_RELOC_SPARC_64 BFD_RELOC_64
+  BFD_RELOC_SPARC_OLO10,
+  BFD_RELOC_SPARC_HH22,
+  BFD_RELOC_SPARC_HM10,
+  BFD_RELOC_SPARC_LM22,
+  BFD_RELOC_SPARC_PC_HH22,
+  BFD_RELOC_SPARC_PC_HM10,
+  BFD_RELOC_SPARC_PC_LM22,
+  BFD_RELOC_SPARC_WDISP16,
+  BFD_RELOC_SPARC_WDISP19,
+  BFD_RELOC_SPARC_GLOB_JMP,
+  BFD_RELOC_SPARC_LO7,
+   /* end-sanitize-v9 */
+
+   /* 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) */
+   /* 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.  */
+   /* 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
-          extended and added to form the final result.  If the low 16
-          bits form a negative number, we need to add one to the high value
-          to compensate for the borrow when the low bits are added.  */
+   /* High 16 bits of 32-bit value but the low 16 bits will be sign
+     extended and added to form the final result.  If the low 16
+     bits form a negative number, we need to add one to the high value
+     to compensate for the borrow when the low bits are added.  */
   BFD_RELOC_HI16_S,
-        /* Low 16 bits.  */
+   /* Low 16 bits.  */
   BFD_RELOC_LO16,
 
-        /* 16 bit relocation relative to the global pointer.  */
+   /* 16 bit relocation relative to the global pointer.  */
   BFD_RELOC_MIPS_GPREL,
 
-        /* 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.  Also, many more were in the list I got that don't
-          fit in well in the model BFD uses, so I've omitted them for now.
-          If we do make this reloc type get used for code that really does
-          implement the funky reloc types, they'll have to be added to this
-          list.   */
+   /* 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.
+     Also, many more were in the list I got that don't fit in well in the
+     model BFD uses, so I've omitted them for now.  If we do make this reloc
+     type get used for code that really does implement the funky reloc types,
+     they'll have to be added to this list.  */
   BFD_RELOC_HPPA_32,
   BFD_RELOC_HPPA_11,
   BFD_RELOC_HPPA_14,
   BFD_RELOC_HPPA_17,
+
   BFD_RELOC_HPPA_L21,
   BFD_RELOC_HPPA_R11,
   BFD_RELOC_HPPA_R14,
@@ -1141,6 +1213,7 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_HPPA_LR21,
   BFD_RELOC_HPPA_RR14,
   BFD_RELOC_HPPA_RR17,
+
   BFD_RELOC_HPPA_GOTOFF_11,
   BFD_RELOC_HPPA_GOTOFF_14,
   BFD_RELOC_HPPA_GOTOFF_L21,
@@ -1154,12 +1227,14 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_HPPA_GOTOFF_RD14,
   BFD_RELOC_HPPA_GOTOFF_LR21,
   BFD_RELOC_HPPA_GOTOFF_RR14,
+
   BFD_RELOC_HPPA_DLT_32,
   BFD_RELOC_HPPA_DLT_11,
   BFD_RELOC_HPPA_DLT_14,
   BFD_RELOC_HPPA_DLT_L21,
   BFD_RELOC_HPPA_DLT_R11,
   BFD_RELOC_HPPA_DLT_R14,
+
   BFD_RELOC_HPPA_ABS_CALL_11,
   BFD_RELOC_HPPA_ABS_CALL_14,
   BFD_RELOC_HPPA_ABS_CALL_17,
@@ -1178,6 +1253,7 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_HPPA_ABS_CALL_LR21,
   BFD_RELOC_HPPA_ABS_CALL_RR14,
   BFD_RELOC_HPPA_ABS_CALL_RR17,
+
   BFD_RELOC_HPPA_PCREL_CALL_11,
   BFD_RELOC_HPPA_PCREL_CALL_12,
   BFD_RELOC_HPPA_PCREL_CALL_14,
@@ -1197,15 +1273,27 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_HPPA_PCREL_CALL_LR21,
   BFD_RELOC_HPPA_PCREL_CALL_RR14,
   BFD_RELOC_HPPA_PCREL_CALL_RR17,
+
   BFD_RELOC_HPPA_PLABEL_32,
   BFD_RELOC_HPPA_PLABEL_11,
   BFD_RELOC_HPPA_PLABEL_14,
   BFD_RELOC_HPPA_PLABEL_L21,
   BFD_RELOC_HPPA_PLABEL_R11,
   BFD_RELOC_HPPA_PLABEL_R14,
+
   BFD_RELOC_HPPA_UNWIND_ENTRY,
   BFD_RELOC_HPPA_UNWIND_ENTRIES,
 
+   /* i386/elf relocations */
+  BFD_RELOC_386_GOT32,
+  BFD_RELOC_386_PLT32,
+  BFD_RELOC_386_COPY,
+  BFD_RELOC_386_GLOB_DAT,
+  BFD_RELOC_386_JUMP_SLOT,
+  BFD_RELOC_386_RELATIVE,
+  BFD_RELOC_386_GOTOFF,
+  BFD_RELOC_386_GOTPC,
+
    /* this must be the highest numeric value */
   BFD_RELOC_UNUSED
  } bfd_reloc_code_real_type;
@@ -1213,6 +1301,7 @@ CONST struct reloc_howto_struct *
 
 bfd_reloc_type_lookup  PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
 
+
 typedef struct symbol_cache_entry 
 {
         /* A pointer to the BFD which owns the symbol. This information
@@ -1250,11 +1339,11 @@ typedef struct symbol_cache_entry
 
         /* The symbol has global scope, and is exported. The value is
           the offset into the section of the data. */
-#define BSF_EXPORT     0x04
+#define BSF_EXPORT     BSF_GLOBAL  /* no real difference */
 
         /* A normal C symbol would be one of:
           <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
-          <<BSF_EXPORT|BSD_GLOBAL>> */
+          <<BSF_GLOBAL>> */
 
         /* The symbol is a debugging record. The value has an arbitary
           meaning. */
@@ -1268,7 +1357,8 @@ typedef struct symbol_cache_entry
 #define BSF_KEEP        0x20
 #define BSF_KEEP_G      0x40
 
-        /* ... document me ... */
+        /* A weak global symbol, overridable without warnings by
+          a regular global symbol of the same name.  */
 #define BSF_WEAK        0x80
 
         /* This symbol was created to point to a section, e.g. ELF's
@@ -1460,11 +1550,12 @@ struct _bfd
       struct srec_data_struct *srec_data;
       struct tekhex_data_struct *tekhex_data;
       struct elf_obj_tdata *elf_obj_data;
+      struct nlm_obj_tdata *nlm_obj_data;
       struct bout_data_struct *bout_data;
       struct sun_core_struct *sun_core_data;
       struct trad_core_struct *trad_core_data;
       struct hppa_data_struct *hppa_data;
-      struct hppa_core_struct *hppa_core_data;
+      struct hpux_core_struct *hpux_core_data;
       struct sgi_core_struct *sgi_core_data;
       PTR any;
       } tdata;
@@ -1513,6 +1604,9 @@ bfd_get_gp_size PARAMS ((bfd *));
 void 
 bfd_set_gp_size PARAMS ((bfd *, int));
 
+bfd_vma 
+bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
+
 #define bfd_sizeof_headers(abfd, reloc) \
      BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
 
@@ -1580,6 +1674,7 @@ typedef struct bfd_target
     bfd_target_ecoff_flavour,
     bfd_target_elf_flavour,
     bfd_target_ieee_flavour,
+    bfd_target_nlm_flavour,
     bfd_target_oasys_flavour,
     bfd_target_tekhex_flavour,
     bfd_target_srec_flavour,
This page took 0.038169 seconds and 4 git commands to generate.