*-config.texi: introduce new switch GENERIC to describe text *only* for
[deliverable/binutils-gdb.git] / include / bfd.h
index 9475bff8103b719c6091bc07f614ccc13c9a7327..cb58f457a36bcc00dea8563339472dc4df09cc6b 100644 (file)
@@ -1,7 +1,7 @@
 /* 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 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -45,7 +45,7 @@ here.  */
 #include "ansidecl.h"
 #include "obstack.h"
 
-#define BFD_VERSION "2.0"
+#define BFD_VERSION "2.1"
 
 /* forward declaration */
 typedef struct _bfd bfd;
@@ -144,7 +144,7 @@ typedef int symtype;                /* Who knows, yet? */
 #define bfd_get_output_section(x) ((x)->section->output_section)
 #define bfd_set_section(x,y) ((x)->section) = (y)
 #define bfd_asymbol_base(x) ((x)->section->vma)
-#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + x->value)
+#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
 #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)
@@ -193,6 +193,8 @@ typedef struct sec *sec_ptr;
 #define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
 #define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
 
+#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+
 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (val)), ((ptr)->user_set_vma = true), true)
 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
@@ -287,7 +289,10 @@ 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_relax_section),\
+CAT(NAME,_bfd_seclet_link),\
+CAT(NAME,_bfd_reloc_type_lookup),\
+CAT(NAME,_bfd_make_debug_symbol)
 
 #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
 
@@ -461,15 +466,13 @@ typedef struct sec
          /* The section is a constuctor, and should be placed at the
           end of the . */
 
-
 #define SEC_CONSTRUCTOR_TEXT 0x1100
 
 #define SEC_CONSTRUCTOR_DATA 0x2100
 
 #define SEC_CONSTRUCTOR_BSS  0x3100
 
-
-         /* The section has contents - a bss section could be
+         /* The section has contents - a data section could be
            <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>, a debug section could be
            <<SEC_HAS_CONTENTS>> */
 
@@ -487,6 +490,13 @@ typedef struct sec
 
 #define SEC_SHARED_LIBRARY 0x800
 
+         /* The section is a common section (symbols may be defined
+           multiple times, the value of a symbol is the amount of
+           space it requires, and the largest symbol value is the one
+           used).  Most targets have exactly one of these (.bss), but
+           ECOFF has two. */
+
+#define SEC_IS_COMMON 0x8000
        
    bfd_vma vma;
    boolean user_set_vma;
@@ -684,6 +694,7 @@ enum bfd_architecture
   bfd_arch_z8k,        /* Zilog Z8000 */
 #define bfd_mach_z8001         1
 #define bfd_mach_z8002         2
+  bfd_arch_h8500,      /* Hitachi H8/500 */
   bfd_arch_last
   };
 
@@ -815,11 +826,11 @@ typedef CONST struct reloc_howto_struct
   unsigned int rightshift;
 
         /*  The size of the item to be relocated - 0, is one byte, 1 is 2
-           bytes, 3 is four bytes.  A -ve value indicates that the
-           result is to be subtracted from the data*/
+           bytes, 2 is four bytes.  A negative value indicates that the
+           result is to be subtracted from the data.  */
   int size;
 
-        /*  Now obsolete.  But m68k-coff still uses it. */
+        /*  Now obsolete?  But m68k-coff still uses it... */
   unsigned int bitsize;
 
         /*  Notes that the relocation is relative to the location in the
@@ -830,10 +841,8 @@ typedef CONST struct reloc_howto_struct
 
   unsigned int bitpos;
 
-#if 1
         /*  Now obsolete */
   boolean absolute;
-#endif
 
         /* Causes the relocation routine to return an error if overflow
           is detected when relocating. */
@@ -841,7 +850,7 @@ typedef CONST struct reloc_howto_struct
 
         /* If this field is non null, then the supplied function is
           called rather than the normal function. This allows really
-          strange relocation methods to be accomodated (eg, i960 callj
+          strange relocation methods to be accomodated (e.g., i960 callj
           instructions). */
   bfd_reloc_status_type (*special_function) 
                                    PARAMS ((bfd *abfd,
@@ -859,7 +868,7 @@ typedef CONST struct reloc_howto_struct
   boolean partial_inplace;
 
         /* The src_mask is used to select what parts of the read in data
-          are to be used in the relocation sum. Eg, if this was an 8 bit
+          are to be used in the relocation sum.  E.g., if this was an 8 bit
           bit of data which we read and relocated, this would be
           0x000000ff. When we have relocs which have an addend, such as
           sun4 extended relocs, the value in the offset part of a
@@ -876,9 +885,9 @@ typedef CONST struct reloc_howto_struct
         /* When some formats create PC relative instructions, they leave
           the value of the pc of the place being relocated in the offset
           slot of the instruction, so that a PC relative relocation can
-          be made just by adding in an ordinary offset (eg sun3 a.out).
+          be made just by adding in an ordinary offset (e.g., sun3 a.out).
           Some formats leave the displacement part of an instruction
-          empty (eg m88k bcs), this flag signals the fact.*/
+          empty (e.g., m88k bcs), this flag signals the fact.*/
   boolean pcrel_offset;
 
 } reloc_howto_type;
@@ -889,7 +898,7 @@ typedef CONST struct reloc_howto_struct
 #define HOWTO_PREPARE(relocation, symbol)      \
   {                                            \
   if (symbol != (asymbol *)NULL) {             \
-    if (symbol->section == &bfd_com_section) { \
+    if (bfd_is_com_section (symbol->section)) { \
       relocation = 0;                          \
     }                                          \
     else {                                     \
@@ -973,6 +982,23 @@ typedef enum bfd_reloc_code_real
    /* this one is a.out specific? */
   BFD_RELOC_SPARC_BASE22,
 
+        /* 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
+          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.  */
+  BFD_RELOC_LO16,
+
    /* this must be the highest numeric value */
   BFD_RELOC_UNUSED
  } bfd_reloc_code_real_type;
@@ -1092,9 +1118,6 @@ typedef struct symbol_cache_entry
           of making this a union. */
   PTR udata;
 
-        /* Application data. */
-  union { unsigned long aflags; PTR aptr; } app_data;
-
 } asymbol;
 #define get_symtab_upper_bound(abfd) \
      BFD_SEND (abfd, _get_symtab_upper_bound, (abfd))
@@ -1227,6 +1250,7 @@ struct _bfd
       struct _oasys_data *oasys_obj_data;
       struct _oasys_ar_data *oasys_ar_data;
       struct coff_tdata *coff_obj_data;
+      struct ecoff_tdata *ecoff_obj_data;
       struct ieee_data_struct *ieee_data;
       struct ieee_ar_data_struct *ieee_ar_data;
       struct srec_data_struct *srec_data;
@@ -1275,7 +1299,7 @@ bfd_set_start_address PARAMS ((bfd *, bfd_vma));
 long 
 bfd_get_mtime PARAMS ((bfd *));
 
-long
+long 
 bfd_get_size PARAMS ((bfd *));
 
 #define bfd_sizeof_headers(abfd, reloc) \
@@ -1301,11 +1325,14 @@ bfd_get_size PARAMS ((bfd *));
 #define bfd_set_arch_mach(abfd, arch, mach)\
         BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
 
-#define bfd_get_relocated_section_contents(abfd, seclet, data) \
-       BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data))
+#define bfd_get_relocated_section_contents(abfd, seclet, data, relocateable) \
+       BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data, relocateable))
  
 #define bfd_relax_section(abfd, section, symbols) \
        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, symbols))
+
+#define bfd_seclet_link(abfd, data, relocateable) \
+       BFD_SEND (abfd, _bfd_seclet_link, (abfd, data, relocateable))
 symindex 
 bfd_get_next_mapent PARAMS ((bfd *, symindex previous, carsym ** sym));
 
@@ -1339,6 +1366,7 @@ typedef struct bfd_target
     bfd_target_unknown_flavour,
     bfd_target_aout_flavour,
     bfd_target_coff_flavour,
+    bfd_target_ecoff_flavour,
     bfd_target_elf_flavour,
     bfd_target_ieee_flavour,
     bfd_target_oasys_flavour,
@@ -1418,10 +1446,14 @@ typedef struct bfd_target
   void       (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *));
 
   bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
-                    struct bfd_seclet *, bfd_byte *data));
+                    struct bfd_seclet *, bfd_byte *data,
+                    boolean relocateable));
 
   boolean    (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
                     struct symbol_cache_entry **));
+
+  boolean    (*_bfd_seclet_link) PARAMS ((bfd *, PTR data,
+                     boolean relocateable));
   /* See documentation on reloc types.  */
  CONST struct reloc_howto_struct *
        (*reloc_type_lookup) PARAMS ((bfd *abfd,
This page took 0.027081 seconds and 4 git commands to generate.