* reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S
[deliverable/binutils-gdb.git] / bfd / bfd-in2.h
index e46f647bc8c421e12dd85cfad2ed6c15fd3d025c..997abcd29021ca4d1cf29dc60fd972cb8175eae0 100644 (file)
@@ -1,5 +1,5 @@
 /* Main header file for the bfd library -- portable access to object files.
-   Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 ** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
@@ -389,11 +389,6 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
                                                    PTR),
                                       PTR info));
 \f
-/* The code that implements targets can initialize a jump table with this
-   macro.  It must name all its routines the same way (a prefix plus
-   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.
    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
@@ -419,47 +414,7 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
 #endif
 #endif
 
-#define JUMP_TABLE(NAME)\
-CAT(NAME,_core_file_failing_command),\
-CAT(NAME,_core_file_failing_signal),\
-CAT(NAME,_core_file_matches_executable_p),\
-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,_set_section_contents),\
-CAT(NAME,_get_section_contents),\
-CAT(NAME,_new_section_hook),\
-CAT(NAME,_bfd_copy_private_section_data),\
-CAT(NAME,_bfd_copy_private_bfd_data),\
-CAT(NAME,_get_symtab_upper_bound),\
-CAT(NAME,_get_symtab),\
-CAT(NAME,_get_reloc_upper_bound),\
-CAT(NAME,_canonicalize_reloc),\
-CAT(NAME,_make_empty_symbol),\
-CAT(NAME,_print_symbol),\
-CAT(NAME,_get_symbol_info),\
-CAT(NAME,_bfd_is_local_label),\
-CAT(NAME,_get_lineno),\
-CAT(NAME,_set_arch_mach),\
-CAT(NAME,_openr_next_archived_file),\
-CAT(NAME,_find_nearest_line),\
-CAT(NAME,_generic_stat_arch_elt),\
-CAT(NAME,_sizeof_headers),\
-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_reloc_type_lookup),\
-CAT(NAME,_bfd_make_debug_symbol),\
-CAT(NAME,_bfd_link_hash_table_create),\
-CAT(NAME,_bfd_link_add_symbols),\
-CAT(NAME,_bfd_final_link)
-
 #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
-
 \f
 /* User program access to BFD facilities */
 
@@ -1255,6 +1210,7 @@ typedef enum bfd_reloc_code_real
    /* Basic absolute relocations */
   BFD_RELOC_64,
   BFD_RELOC_32,
+  BFD_RELOC_26,
   BFD_RELOC_16,
   BFD_RELOC_14,
   BFD_RELOC_8,
@@ -1393,6 +1349,10 @@ typedef enum bfd_reloc_code_real
   BFD_RELOC_HI16_S,
    /* Low 16 bits.  */
   BFD_RELOC_LO16,
+   /* Like BFD_RELOC_HI16_S, but PC relative.  */
+  BFD_RELOC_PCREL_HI16_S,
+   /* Like BFD_RELOC_LO16, but PC relative.  */
+  BFD_RELOC_PCREL_LO16,
 
    /* relocation relative to the global pointer.  */
 #define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16
@@ -1928,6 +1888,21 @@ bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 #define bfd_final_link(abfd, info) \
        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
 
+#define bfd_free_cached_info(abfd) \
+       BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
+
+#define bfd_get_dynamic_symtab_upper_bound(abfd) \
+       BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
+
+#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
+       BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
+
+#define bfd_get_dynamic_reloc_upper_bound(abfd) \
+       BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
+
+#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
+       BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
+
 symindex 
 bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
 
@@ -2020,9 +1995,52 @@ typedef struct bfd_target
   struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
   boolean             (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
   boolean             (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
+
+   /* Generic entry points.  */
+#define BFD_JUMP_TABLE_GENERIC(NAME)\
+CAT(NAME,_close_and_cleanup),\
+CAT(NAME,_bfd_free_cached_info),\
+CAT(NAME,_new_section_hook),\
+CAT(NAME,_get_section_contents)
+   /* Called when the BFD is being closed to do any necessary cleanup.  */
+  boolean       (*_close_and_cleanup) PARAMS ((bfd *));
+   /* Ask the BFD to free all cached information.  */
+  boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
+   /* Called when a new section is created.  */
+  boolean       (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
+   /* Read the contents of a section.  */
+  boolean       (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 
+                                            file_ptr, bfd_size_type));
+
+   /* 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)
+   /* Called to copy BFD general private data from one object file
+     to another.  */
+  boolean       (*_bfd_copy_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));
+
+   /* Core file entry points.  */
+#define BFD_JUMP_TABLE_CORE(NAME)\
+CAT(NAME,_core_file_failing_command),\
+CAT(NAME,_core_file_failing_signal),\
+CAT(NAME,_core_file_matches_executable_p)
   char *   (*_core_file_failing_command) PARAMS ((bfd *));
   int      (*_core_file_failing_signal) PARAMS ((bfd *));
   boolean  (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
+
+   /* Archive entry points.  */
+#define BFD_JUMP_TABLE_ARCHIVE(NAME)\
+CAT(NAME,_slurp_armap),\
+CAT(NAME,_slurp_extended_name_table),\
+CAT(NAME,_truncate_arname),\
+CAT(NAME,_write_armap),\
+CAT(NAME,_openr_next_archived_file),\
+CAT(NAME,_generic_stat_arch_elt)
   boolean  (*_bfd_slurp_armap) PARAMS ((bfd *));
   boolean  (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
   void     (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
@@ -2031,21 +2049,23 @@ typedef struct bfd_target
                               struct orl *map,
                               unsigned int orl_count, 
                               int stridx));
-  boolean       (*_close_and_cleanup) PARAMS ((bfd *));
-  boolean       (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
-                                            file_ptr, bfd_size_type));
-  boolean       (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 
-                                            file_ptr, bfd_size_type));
-  boolean       (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
-  boolean       (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
-                                                       bfd *, sec_ptr));
-  boolean       (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
+  bfd *      (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
+  int        (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
+   /* Entry points used for symbols.  */
+#define BFD_JUMP_TABLE_SYMBOLS(NAME)\
+CAT(NAME,_get_symtab_upper_bound),\
+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,_get_lineno),\
+CAT(NAME,_find_nearest_line),\
+CAT(NAME,_bfd_make_debug_symbol)
   long  (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
   long  (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
                                              struct symbol_cache_entry **));
-  long  (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
-  long  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
-                                            struct symbol_cache_entry **));
   struct symbol_cache_entry  *
                 (*_bfd_make_empty_symbol) PARAMS ((bfd *));
   void          (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
@@ -2057,26 +2077,51 @@ typedef struct bfd_target
                                       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 *));
-  alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
-
-  boolean    (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
-                    unsigned long));
 
-  bfd *      (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
+  alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
   boolean    (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
                     struct sec *section, struct symbol_cache_entry **symbols,
                     bfd_vma offset, CONST char **file, CONST char **func,
                     unsigned int *line));
-  int        (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
+  /* Back-door to allow format-aware applications to create debug symbols
+    while using BFD for everything else.  Currently used by the assembler
+    when creating COFF files.  */
+ asymbol *  (*_bfd_make_debug_symbol) PARAMS ((
+       bfd *abfd,
+       void *ptr,
+       unsigned long size));
 
-  int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
+   /* Routines for relocs.  */
+#define BFD_JUMP_TABLE_RELOCS(NAME)\
+CAT(NAME,_get_reloc_upper_bound),\
+CAT(NAME,_canonicalize_reloc),\
+CAT(NAME,_bfd_reloc_type_lookup)
+  long  (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
+  long  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
+                                            struct symbol_cache_entry **));
+   /* See documentation on reloc types.  */
+  CONST struct reloc_howto_struct *
+       (*reloc_type_lookup) PARAMS ((bfd *abfd,
+                                     bfd_reloc_code_real_type code));
 
-  void       (*_bfd_debug_info_start) PARAMS ((bfd *));
-  void       (*_bfd_debug_info_end) PARAMS ((bfd *));
-  void       (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *));
+   /* Routines used when writing an object file.  */
+#define BFD_JUMP_TABLE_WRITE(NAME)\
+CAT(NAME,_set_arch_mach),\
+CAT(NAME,_set_section_contents)
+  boolean    (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
+                    unsigned long));
+  boolean       (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
+                                            file_ptr, bfd_size_type));
 
+   /* Routines used by the linker.  */
+#define BFD_JUMP_TABLE_LINK(NAME)\
+CAT(NAME,_sizeof_headers),\
+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)
+  int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
   bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
                     struct bfd_link_info *, struct bfd_link_order *,
                     bfd_byte *data, boolean relocateable,
@@ -2085,29 +2130,33 @@ typedef struct bfd_target
   boolean    (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
                     struct bfd_link_info *, boolean *again));
 
-  /* See documentation on reloc types.  */
- CONST struct reloc_howto_struct *
-       (*reloc_type_lookup) PARAMS ((bfd *abfd,
-                                     bfd_reloc_code_real_type code));
-
-  /* Back-door to allow format-aware applications to create debug symbols
-    while using BFD for everything else.  Currently used by the assembler
-    when creating COFF files.  */
- asymbol *  (*_bfd_make_debug_symbol) PARAMS ((
-       bfd *abfd,
-       void *ptr,
-       unsigned long size));
-
-  /* Create a hash table for the linker.  Different backends store
-    different information in this table.  */
- struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
-
-  /* Add symbols from this object file into the hash table.  */
- boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
-
-  /* Do a link based on the link_order structures attached to each
-    section of the BFD.  */
- boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
+   /* Create a hash table for the linker.  Different backends store
+     different information in this table.  */
+  struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
+
+   /* Add symbols from this object file into the hash table.  */
+  boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
+
+   /* Do a link based on the link_order structures attached to each
+     section of the BFD.  */
+  boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
+
+  /* Routines to handle dynamic symbols and relocs.  */
+#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
+CAT(NAME,_get_dynamic_symtab_upper_bound),\
+CAT(NAME,_canonicalize_dynamic_symtab),\
+CAT(NAME,_get_dynamic_reloc_upper_bound),\
+CAT(NAME,_canonicalize_dynamic_reloc)
+   /* Get the amount of memory required to hold the dynamic symbols. */
+  long  (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
+   /* Read in the dynamic symbols.  */
+  long  (*_bfd_canonicalize_dynamic_symtab)
+    PARAMS ((bfd *, struct symbol_cache_entry **));
+   /* Get the amount of memory required to hold the dynamic relocs.  */
+  long  (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
+   /* Read in the dynamic relocs.  */
+  long  (*_bfd_canonicalize_dynamic_reloc)
+    PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
 
  PTR backend_data;
 } bfd_target;
This page took 0.031479 seconds and 4 git commands to generate.