* elf32-mips.c (mips_elf_object_p): Unconditionally set
[deliverable/binutils-gdb.git] / bfd / bfd-in2.h
index 9beb9710255d948b2dfd14d98c11189206d27a10..91d5cc9738feff83daa4db41f7bb67d089fd8c32 100644 (file)
@@ -1,5 +1,5 @@
 /* Main header file for the bfd library -- portable access to object files.
-   Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 ** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
@@ -82,11 +82,16 @@ typedef struct _bfd bfd;
 /* typedef enum boolean {false, true} boolean; */
 /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h>  -fnf */
 /* It gets worse if the host also defines a true/false enum... -sts */
+/* And even worse if your compiler has built-in boolean types... -law */
+#if defined (__GNUG__) && (__GNUC_MINOR__ > 5)
+#define TRUE_FALSE_ALREADY_DEFINED
+#endif
 #ifndef TRUE_FALSE_ALREADY_DEFINED
 typedef enum bfd_boolean {false, true} boolean;
 #define BFD_TRUE_FALSE
 #else
-typedef enum bfd_boolean {bfd_false, bfd_true} boolean;
+/* Use enum names that will appear nowhere else.  */
+typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
 #endif
 
 /* A pointer to a position in a file.  */
@@ -160,6 +165,7 @@ typedef unsigned long bfd_size_type;
 #define printf_vma(x) fprintf_vma(stdout,x)
 
 typedef unsigned int flagword; /* 32 bits of flags */
+typedef unsigned char bfd_byte;
 \f
 /** File formats */
 
@@ -229,6 +235,9 @@ typedef enum bfd_format {
 /* A count of carsyms (canonical archive symbols).  */
 typedef unsigned long symindex;
 
+/* How to perform a relocation.  */
+typedef const struct reloc_howto_struct reloc_howto_type;
+
 #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
 
 /* General purpose part of a symbol X;
@@ -259,7 +268,6 @@ struct orl {                        /* output ranlib */
   file_ptr pos;                        /* bfd* or file position */
   int namidx;                  /* index into string table */
 };
-
 \f
 
 /* Linenumber stuff */
@@ -290,7 +298,7 @@ typedef struct sec *sec_ptr;
 
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
 
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = true), true)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = (boolean)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)
 
@@ -437,6 +445,46 @@ extern long bfd_tell PARAMS ((bfd *abfd));
 extern int bfd_flush PARAMS ((bfd *abfd));
 extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
 
+/* PE STUFF */
+/* Also define some types which are used within bfdlink.h for the
+   bfd_link_info struct.  These are not defined in bfdlink.h for a reason.  
+   When the link_info data is passed to bfd from ld, it is copied into 
+   extern variables defined in internal.h.  The type class for these must
+   be available to any thing that includes internal.h.  When internal.h is
+   included, it is always preceeded by an include on this file.  If I leave the
+   type definitions in bfdlink.h, then I must include that file when ever
+   I include internal.h, and this is not always a good thing */
+
+/* These are the different types of subsystems to be used when linking for
+   Windows NT.  This information is passed in as an input parameter (default
+   is console) and ultimately ends up in the optional header data */
+enum bfd_link_subsystem
+{
+  native,    /* image doesn't require a subsystem */
+  windows,   /* image runs in the Windows GUI subsystem */
+  console,   /* image runs in the Windows CUI (character) subsystem */
+  os2,       /* image runs in the OS/2 character subsystem */
+  posix      /* image runs in the posix character subsystem */
+};
+/* The NT optional header file allows input of the stack and heap reserve
+   and commit size.  This data may be input on the command line and will
+   end up in the optional header.  Default sizes are provided. */
+struct _bfd_link_stack_heap
+{
+  boolean stack_defined;
+  boolean heap_defined;
+  bfd_vma stack_reserve;
+  bfd_vma stack_commit;
+  bfd_vma heap_reserve;
+  bfd_vma heap_commit; 
+};
+typedef struct _bfd_link_stack_heap bfd_link_stack_heap;
+
+/* END OF PE STUFF */
+
+extern enum bfd_link_subsystem NT_subsystem;
+extern bfd_link_stack_heap NT_stack_heap;
+
 /* Cast from const char * to char * so that caller can assign to
    a char * without a warning.  */
 #define bfd_get_filename(abfd) ((char *) (abfd)->filename)
@@ -460,7 +508,7 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
 
 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
 
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (bool)), true)
+#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true)
 
 /* Byte swapping routines.  */
 
@@ -537,13 +585,24 @@ 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));
+extern boolean bfd_mips_ecoff_create_embedded_relocs
+  PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
+          char **));
 
 /* Externally visible ELF routines.  */
 
 extern boolean bfd_elf32_record_link_assignment
-  PARAMS ((bfd *, struct bfd_link_info *, const char *));
+  PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
 extern boolean bfd_elf64_record_link_assignment
-  PARAMS ((bfd *, struct bfd_link_info *, const char *));
+  PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
+struct bfd_elf_link_needed_list
+{
+  struct bfd_elf_link_needed_list *next;
+  bfd *by;
+  const char *name;
+};
+extern struct bfd_elf_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 **));
@@ -575,6 +634,9 @@ bfd_openr PARAMS ((CONST char *filename, CONST char *target));
 bfd *
 bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
 
+bfd *
+bfd_openstreamr PARAMS (());
+
 bfd *
 bfd_openw PARAMS ((CONST char *filename, CONST char *target));
 
@@ -1027,6 +1089,17 @@ enum bfd_architecture
   bfd_arch_alpha,      /* Dec Alpha */
   bfd_arch_arm,        /* Advanced Risc Machines ARM */
   bfd_arch_ns32k,      /* National Semiconductors ns32000 */
+  bfd_arch_w65,        /* WDC 65816 */
+  /* start-sanitize-rce */
+  bfd_arch_rce,        /* Motorola RCE */
+  /* end-sanitize-rce */
+  /* start-sanitize-arc */
+  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_last
   };
 
@@ -1140,7 +1213,7 @@ typedef struct reloc_cache_entry
   bfd_vma addend;
 
         /* Pointer to how to perform the required relocation */
-  const struct reloc_howto_struct *howto;
+  reloc_howto_type *howto;
 
 } arelent;
 enum complain_overflow
@@ -1161,9 +1234,6 @@ enum complain_overflow
   complain_overflow_unsigned
 };
 
-typedef unsigned char bfd_byte;
-typedef struct reloc_howto_struct reloc_howto_type;
-
 struct reloc_howto_struct
 {
         /*  The type field has mainly a documetary use - the back end can
@@ -1261,7 +1331,7 @@ struct reloc_howto_struct
   }                                            \
 }
 int 
-bfd_get_reloc_size  PARAMS ((const reloc_howto_type *));
+bfd_get_reloc_size  PARAMS ((reloc_howto_type *));
 
 typedef struct relent_chain {
   arelent relent;
@@ -1310,6 +1380,25 @@ The 24-bit relocation is used in some Intel 960 configurations. */
   BFD_RELOC_12_PCREL,
   BFD_RELOC_8_PCREL,
 
+/* For ELF. */
+  BFD_RELOC_32_GOT_PCREL,
+  BFD_RELOC_16_GOT_PCREL,
+  BFD_RELOC_8_GOT_PCREL,
+  BFD_RELOC_32_GOTOFF,
+  BFD_RELOC_16_GOTOFF,
+  BFD_RELOC_8_GOTOFF,
+  BFD_RELOC_32_PLT_PCREL,
+  BFD_RELOC_16_PLT_PCREL,
+  BFD_RELOC_8_PLT_PCREL,
+  BFD_RELOC_32_PLTOFF,
+  BFD_RELOC_16_PLTOFF,
+  BFD_RELOC_8_PLTOFF,
+
+/* Relocations used by 68K ELF. */
+  BFD_RELOC_68K_GLOB_DAT,
+  BFD_RELOC_68K_JMP_SLOT,
+  BFD_RELOC_68K_RELATIVE,
+
 /* Linkage-table relative. */
   BFD_RELOC_32_BASEREL,
   BFD_RELOC_16_BASEREL,
@@ -1507,9 +1596,27 @@ not stored in the instruction. */
   BFD_RELOC_ARM_SWI,
   BFD_RELOC_ARM_MULTI,
   BFD_RELOC_ARM_CP_OFF_IMM,
+  BFD_RELOC_ARM_ADR_IMM,
+  BFD_RELOC_ARM_LDR_IMM,
+  BFD_RELOC_ARM_LITERAL,
+  BFD_RELOC_ARM_IN_POOL,
+/* start-sanitize-arc */
+
+/* Argonaut RISC Core (ARC) relocs.
+ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
+not stored in the instruction.  The high 20 bits are installed in bits 26
+through 7 of the instruction. */
+  BFD_RELOC_ARC_B22_PCREL,
+
+/* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
+stored in the instruction.  The high 24 bits are installed in bits 23
+through 0. */
+  BFD_RELOC_ARC_B26,
+/* end-sanitize-arc */
+
   BFD_RELOC_UNUSED };
 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
-const struct reloc_howto_struct *
+reloc_howto_type *
 
 bfd_reloc_type_lookup  PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
 
@@ -1657,6 +1764,12 @@ bfd_decode_symclass PARAMS ((asymbol *symbol));
 void 
 bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
 
+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, \
+               (ibfd, isymbol, obfd, osymbol))
 struct _bfd 
 {
      /* The filename the application opened the BFD with.  */
@@ -1794,6 +1907,7 @@ struct _bfd
       struct lynx_core_struct *lynx_core_data;
       struct osf_core_struct *osf_core_data;
       struct cisco_core_struct *cisco_core_data;
+      struct versados_data_struct *versados_data;
       PTR any;
       } tdata;
   
@@ -1813,6 +1927,7 @@ typedef enum bfd_error
   bfd_error_invalid_operation,
   bfd_error_no_memory,
   bfd_error_no_symbols,
+  bfd_error_no_armap,
   bfd_error_no_more_archived_files,
   bfd_error_malformed_archive,
   bfd_error_file_not_recognized,
@@ -1822,6 +1937,7 @@ typedef enum bfd_error
   bfd_error_no_debug_section,
   bfd_error_bad_value,
   bfd_error_file_truncated,
+  bfd_error_file_too_big,
   bfd_error_invalid_error_code
 } bfd_error_type;
 
@@ -1837,6 +1953,14 @@ bfd_errmsg  PARAMS ((bfd_error_type error_tag));
 void 
 bfd_perror  PARAMS ((CONST char *message));
 
+typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
+
+bfd_error_handler_type 
+bfd_set_error_handler  PARAMS ((bfd_error_handler_type));
+
+void 
+bfd_set_error_program_name  PARAMS ((const char *));
+
 long 
 bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
 
@@ -1880,6 +2004,18 @@ 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))
+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, \
+               (ibfd, obfd))
+boolean 
+bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
+
+#define bfd_set_private_flags(abfd, flags) \
+     BFD_SEND (abfd, _bfd_set_private_flags, \
+               (abfd, flags))
 #define bfd_sizeof_headers(abfd, reloc) \
      BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
 
@@ -1906,10 +2042,6 @@ bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 #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, link_info, link_order, data, relocateable, symbols) \
-       BFD_SEND (abfd, _bfd_get_relocated_section_contents, \
-                 (abfd, link_info, link_order, data, relocateable, symbols))
 #define bfd_relax_section(abfd, section, link_info, again) \
        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
 
@@ -1937,6 +2069,11 @@ bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
        BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
 
+extern bfd_byte *bfd_get_relocated_section_contents
+       PARAMS ((bfd *, struct bfd_link_info *,
+                 struct bfd_link_order *, bfd_byte *,
+                 boolean, asymbol **));
+
 symindex 
 bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
 
@@ -1991,7 +2128,10 @@ enum bfd_flavour {
   bfd_target_tekhex_flavour,
   bfd_target_srec_flavour,
   bfd_target_som_flavour,
-  bfd_target_os9k_flavour};
+  bfd_target_os9k_flavour,
+  bfd_target_versados_flavour,
+  bfd_target_msdos_flavour
+};
 
  /* Forward declaration.  */
 typedef struct bfd_link_info _bfd_link_info;
@@ -2049,14 +2189,26 @@ CAT(NAME,_get_section_contents)
    /* 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)
+CAT(NAME,_bfd_merge_private_bfd_data),\
+CAT(NAME,_bfd_copy_private_section_data),\
+CAT(NAME,_bfd_copy_private_symbol_data),\
+CAT(NAME,_bfd_set_private_flags)
    /* Called to copy BFD general private data from one object file
      to another.  */
   boolean       (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
+   /* Called to merge BFD general private data from one object file
+     to a common output file when linking.  */
+  boolean       (*_bfd_merge_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));
+   /* Called to copy BFD private symbol data from one symbol 
+     to another.  */
+  boolean       (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
+                                                          bfd *, asymbol *));
+   /* Called to set private backend flags */
+  boolean       (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
 
    /* Core file entry points.  */
 #define BFD_JUMP_TABLE_CORE(NAME)\
@@ -2139,7 +2291,7 @@ CAT(NAME,_bfd_reloc_type_lookup)
   long  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
                                             struct symbol_cache_entry **));
    /* See documentation on reloc types.  */
-  CONST struct reloc_howto_struct *
+  reloc_howto_type *
        (*reloc_type_lookup) PARAMS ((bfd *abfd,
                                      bfd_reloc_code_real_type code));
 
@@ -2159,7 +2311,8 @@ 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)
+CAT(NAME,_bfd_final_link),\
+CAT(NAME,_bfd_link_split_section)
   int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
   bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
                     struct bfd_link_info *, struct bfd_link_order *,
@@ -2180,6 +2333,9 @@ CAT(NAME,_bfd_final_link)
      section of the BFD.  */
   boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
 
+   /* Should this section be split up into smaller pieces during linking.  */
+  boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
+
   /* Routines to handle dynamic symbols and relocs.  */
 #define BFD_JUMP_TABLE_DYNAMIC(NAME)\
 CAT(NAME,_get_dynamic_symtab_upper_bound),\
This page took 0.028105 seconds and 4 git commands to generate.