Reflect new indirect info
[deliverable/binutils-gdb.git] / include / bfd.h
index eab71405c9e4d41cfc6cf07cb0ba6ec419d6b223..d41473a9732a8029a6c4083baf4c825cad9c00d2 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;
@@ -594,6 +604,7 @@ typedef struct sec
 #define BFD_ABS_SECTION_NAME "*ABS*"
 #define BFD_UND_SECTION_NAME "*UND*"
 #define BFD_COM_SECTION_NAME "*COM*"
+#define BFD_IND_SECTION_NAME "*IND*"
 
      /* the absolute section */
  extern   asection bfd_abs_section;
@@ -601,10 +612,13 @@ typedef struct sec
  extern   asection bfd_und_section;
      /* Pointer to the common section */
  extern asection bfd_com_section;
+     /* Pointer to the indirect 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;
 #define bfd_get_section_size_before_reloc(section) \
      (section->reloc_done ? (abort(),1): (section)->_raw_size)
 #define bfd_get_section_size_after_reloc(section) \
@@ -684,6 +698,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,7 +830,7 @@ 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 negative value indicates that the
+           bytes, 2 is four bytes.  A negative value indicates that the
            result is to be subtracted from the data.  */
   int size;
 
@@ -887,7 +902,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 {                                     \
@@ -971,6 +986,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;
@@ -1222,6 +1254,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;
@@ -1296,11 +1329,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));
 
@@ -1334,6 +1370,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,
@@ -1413,10 +1450,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.025808 seconds and 4 git commands to generate.