Updated for new macro, type, and structure names.
authorKen Raeburn <raeburn@cygnus>
Tue, 25 May 1993 20:11:26 +0000 (20:11 +0000)
committerKen Raeburn <raeburn@cygnus>
Tue, 25 May 1993 20:11:26 +0000 (20:11 +0000)
Cleaned up some namespace pollution; renamed elf vectors.

bfd/elf32-target.h
bfd/libelf.h
bfd/targets.c

index f8477ab..e26356a 100644 (file)
@@ -26,34 +26,33 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    one for little-endian machines.   */
 
 /* Archives are generic or unimplemented.  */
-#ifndef elf_slurp_armap
-#define elf_slurp_armap                        bfd_slurp_coff_armap
+#ifndef bfd_elf32_slurp_armap
+#define bfd_elf32_slurp_armap          bfd_slurp_coff_armap
 #endif
-#define elf_slurp_extended_name_table  _bfd_slurp_extended_name_table
-#define elf_truncate_arname            bfd_dont_truncate_arname
-#define elf_openr_next_archived_file   bfd_generic_openr_next_archived_file
-#define elf_generic_stat_arch_elt      bfd_generic_stat_arch_elt
-#ifndef elf_write_armap
-#define        elf_write_armap                 coff_write_armap
+#define bfd_elf32_slurp_extended_name_table    _bfd_slurp_extended_name_table
+#define bfd_elf32_truncate_arname              bfd_dont_truncate_arname
+#define bfd_elf32_openr_next_archived_file     bfd_generic_openr_next_archived_file
+#define bfd_elf32_generic_stat_arch_elt        bfd_generic_stat_arch_elt
+#ifndef bfd_elf32_write_armap
+#define        bfd_elf32_write_armap           coff_write_armap
 #endif
 
 /* Ordinary section reading and writing */
-#define elf_new_section_hook           _bfd_dummy_new_section_hook
-#define elf_get_section_contents       bfd_generic_get_section_contents
-/* #define elf_set_section_contents    bfd_generic_set_section_contents */
-#define        elf_close_and_cleanup           bfd_generic_close_and_cleanup
-
-#define elf_bfd_debug_info_start       bfd_void
-#define elf_bfd_debug_info_end         bfd_void
-#define elf_bfd_debug_info_accumulate  (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
-#define elf_bfd_get_relocated_section_contents \
+#define bfd_elf32_new_section_hook             _bfd_dummy_new_section_hook
+#define bfd_elf32_get_section_contents bfd_generic_get_section_contents
+#define        bfd_elf32_close_and_cleanup             bfd_generic_close_and_cleanup
+
+#define bfd_elf32_bfd_debug_info_start bfd_void
+#define bfd_elf32_bfd_debug_info_end   bfd_void
+#define bfd_elf32_bfd_debug_info_accumulate    (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
+#define bfd_elf32_bfd_get_relocated_section_contents \
  bfd_generic_get_relocated_section_contents
-#define elf_bfd_relax_section bfd_generic_relax_section
-#define elf_bfd_seclet_link bfd_generic_seclet_link
-#define elf_bfd_make_debug_symbol \
+#define bfd_elf32_bfd_relax_section bfd_generic_relax_section
+#define bfd_elf32_bfd_seclet_link bfd_generic_seclet_link
+#define bfd_elf32_bfd_make_debug_symbol \
   ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
 
-static CONST struct elf_backend_data elf_bed =
+static CONST struct elf32_backend_data elf32_bed =
 {
   elf_info_to_howto,
   ELF_ARCH,
@@ -113,31 +112,31 @@ bfd_target TARGET_BIG_SYM =
 
   /* bfd_check_format: check the format of a file being read */
   { _bfd_dummy_target,         /* unknown format */
-    elf_object_p,              /* assembler/linker output (object file) */
+    bfd_elf32_object_p,                /* assembler/linker output (object file) */
     bfd_generic_archive_p,     /* an archive */
-    elf_core_file_p            /* a core file */
+    bfd_elf32_core_file_p      /* a core file */
   },
 
   /* bfd_set_format: set the format of a file being written */
   { bfd_false,
-    elf_mkobject,
+    bfd_elf32_mkobject,
     _bfd_generic_mkarchive,
     bfd_false
   },
 
   /* bfd_write_contents: write cached information into a file being written */
   { bfd_false,
-    elf_write_object_contents,
+    bfd_elf32_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false
   },
 
   /* Initialize a jump table with the standard macro.  All names start with
      "elf" */
-  JUMP_TABLE(elf),
+  JUMP_TABLE(bfd_elf32),
 
   /* backend_data: */
-  (PTR) &elf_bed,
+  (PTR) &elf32_bed,
 };
 #endif
 
@@ -195,30 +194,30 @@ bfd_target TARGET_LITTLE_SYM =
 
   /* bfd_check_format: check the format of a file being read */
   { _bfd_dummy_target,         /* unknown format */
-    elf_object_p,              /* assembler/linker output (object file) */
+    bfd_elf32_object_p,                /* assembler/linker output (object file) */
     bfd_generic_archive_p,     /* an archive */
-    elf_core_file_p            /* a core file */
+    bfd_elf32_core_file_p      /* a core file */
   },
 
   /* bfd_set_format: set the format of a file being written */
   { bfd_false,
-    elf_mkobject,
+    bfd_elf32_mkobject,
     _bfd_generic_mkarchive,
     bfd_false
   },
 
   /* bfd_write_contents: write cached information into a file being written */
   { bfd_false,
-    elf_write_object_contents,
+    bfd_elf32_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false
   },
 
   /* Initialize a jump table with the standard macro.  All names start with
      "elf" */
-  JUMP_TABLE(elf),
+  JUMP_TABLE(bfd_elf32),
 
   /* backend_data: */
-  (PTR) &elf_bed,
+  (PTR) &elf32_bed,
 };
 #endif
index 9cd9b16..3d16ae5 100644 (file)
@@ -25,19 +25,36 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "elf/internal.h"
 #include "elf/external.h"
 
+#ifdef __STDC__
+#define CAT3(a,b,c) a##b##c
+#else
+#define CAT3(a,b,c) a/**/b/**/c
+#endif
+
+#if ARCH_SIZE==64
+#ifndef NAME
+#define NAME(x,y) CAT3(x,64_,y)
+#endif
+#else /* ARCH_SIZE==32 */
+#ifndef NAME
+#define NAME(x,y) CAT3(x,32_,y)
+#endif
+#endif
+
 typedef struct
 {
   asymbol symbol;
-  Elf_Internal_Sym internal_elf_sym;
-  Elf_External_Sym native_elf_sym;
+  NAME(Elf,Internal_Sym) internal_elf_sym;
+  NAME(Elf,External_Sym) native_elf_sym;
   /* these are used for the generation of .stabX symbols (?) */
   short desc;
   unsigned char type;
   char other;
-} elf_symbol_type;
+} NAME(elf,symbol_type);
 
-struct elf_backend_data {
-  void (*elf_info_to_howto) PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+struct NAME(elf,backend_data) {
+  void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
+                                    NAME(Elf,Internal_Rela) *));
   enum bfd_architecture arch;
 
   /* @@ I really don't think this should be here.  I don't know what
@@ -45,38 +62,43 @@ struct elf_backend_data {
      that would be considered global, e.g., if you've got a program
      reading and writing many BFDs.  My hunch is that it's specific to
      the output BFD.  If not, put a comment here explaining why.  */
-  elf_symbol_type *global_sym;
+  NAME(elf,symbol_type) *global_sym;
 };
 
-extern bfd_target *elf_object_p PARAMS ((bfd *));
-extern bfd_target *elf_core_file_p PARAMS ((bfd *));
-extern boolean elf_mkobject PARAMS ((bfd *));
-extern boolean elf_write_object_contents PARAMS ((bfd *));
-extern char *elf_core_file_failing_command PARAMS ((bfd *));
-extern int elf_core_file_failing_signal PARAMS ((bfd *));
-extern boolean elf_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
-extern boolean elf_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
-                                                file_ptr, bfd_size_type));
-extern unsigned int elf_get_symtab_upper_bound PARAMS ((bfd *));
-extern unsigned int elf_get_symtab PARAMS ((bfd *, asymbol **));
-extern unsigned int elf_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
-extern unsigned int elf_canonicalize_reloc PARAMS ((bfd *, sec_ptr,
-                                                   arelent **, asymbol **));
-extern asymbol *elf_make_empty_symbol PARAMS ((bfd *));
-extern void elf_print_symbol PARAMS ((bfd *, PTR, asymbol *,
-                                     bfd_print_symbol_type));
-extern void elf_get_symbol_info PARAMS ((bfd *, asymbol *,
-                                        symbol_info *));
-extern alent *elf_get_lineno PARAMS ((bfd *, asymbol *));
-extern boolean elf_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
-                                         unsigned long));
-extern boolean elf_find_nearest_line PARAMS ((bfd *, asection *, asymbol **,
-                                             bfd_vma, CONST char **,
-                                             CONST char **, unsigned int *));
-extern int elf_sizeof_headers PARAMS ((bfd *, boolean));
+extern bfd_target *bfd_elf32_object_p PARAMS ((bfd *));
+extern bfd_target *bfd_elf32_core_file_p PARAMS ((bfd *));
+extern boolean bfd_elf32_mkobject PARAMS ((bfd *));
+extern boolean bfd_elf32_write_object_contents PARAMS ((bfd *));
+extern char *bfd_elf32_core_file_failing_command PARAMS ((bfd *));
+extern int bfd_elf32_core_file_failing_signal PARAMS ((bfd *));
+extern boolean bfd_elf32_core_file_matches_executable_p PARAMS ((bfd *,
+                                                                bfd *));
+extern boolean bfd_elf32_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
+                                                      file_ptr,
+                                                      bfd_size_type));
+extern unsigned int bfd_elf32_get_symtab_upper_bound PARAMS ((bfd *));
+extern unsigned int bfd_elf32_get_symtab PARAMS ((bfd *, asymbol **));
+extern unsigned int bfd_elf32_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
+extern unsigned int bfd_elf32_canonicalize_reloc PARAMS ((bfd *, sec_ptr,
+                                                         arelent **,
+                                                         asymbol **));
+extern asymbol *bfd_elf32_make_empty_symbol PARAMS ((bfd *));
+extern void bfd_elf32_print_symbol PARAMS ((bfd *, PTR, asymbol *,
+                                           bfd_print_symbol_type));
+extern void bfd_elf32_get_symbol_info PARAMS ((bfd *, asymbol *,
+                                          symbol_info *));
+extern alent *bfd_elf32_get_lineno PARAMS ((bfd *, asymbol *));
+extern boolean bfd_elf32_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
+                                               unsigned long));
+extern boolean bfd_elf32_find_nearest_line PARAMS ((bfd *, asection *,
+                                                   asymbol **,
+                                                   bfd_vma, CONST char **,
+                                                   CONST char **,
+                                                   unsigned int *));
+extern int bfd_elf32_sizeof_headers PARAMS ((bfd *, boolean));
 
 /* If the target doesn't have reloc handling written yet:  */
-extern void elf_no_info_to_howto PARAMS ((bfd *, arelent *,
-                                         Elf_Internal_Rela *));
+extern void bfd_elf32_no_info_to_howto PARAMS ((bfd *, arelent *,
+                                               Elf32_Internal_Rela *));
 
 #endif /* _LIBELF_H_ */
index 0fbf6ac..9445f2a 100644 (file)
@@ -342,6 +342,7 @@ in this structure.
 
 /* All known xvecs.  They are listed a second time below, since
    we can't intermix extern's and initializers.  */
+extern bfd_target i386lynx_vec;
 extern bfd_target ecoff_little_vec;
 extern bfd_target ecoff_big_vec;
 extern bfd_target aout_mips_little_vec;
@@ -356,10 +357,10 @@ extern bfd_target b_out_vec_little_host;
 extern bfd_target b_out_vec_big_host;
 extern bfd_target icoff_little_vec;
 extern bfd_target icoff_big_vec;
-extern bfd_target elf32_sparc_vec;
-extern bfd_target elf32_i386_vec;
-extern bfd_target elf32_m68k_vec;
-extern bfd_target elf32_i860_vec;
+extern bfd_target bfd_elf32_sparc_vec;
+extern bfd_target bfd_elf32_i386_vec;
+extern bfd_target bfd_elf32_m68k_vec;
+extern bfd_target bfd_elf32_i860_vec;
 extern bfd_target ieee_vec;
 extern bfd_target oasys_vec;
 extern bfd_target m88kbcs_vec;
@@ -386,7 +387,6 @@ extern bfd_target hppa_vec;
 extern bfd_target DEFAULT_VECTOR;
 #endif
 
-
 bfd_target *target_vector[] = {
 
 #ifdef SELECT_VECS
@@ -401,6 +401,7 @@ bfd_target *target_vector[] = {
 
        &i386coff_vec,
        &i386aout_vec,
+       &i386lynx_vec,
        &ecoff_little_vec,
        &ecoff_big_vec,
        &aout_mips_little_vec,
@@ -426,10 +427,10 @@ bfd_target *target_vector[] = {
 /*     &tekhex_vec,*/
        &icoff_little_vec,
        &icoff_big_vec,
-       &elf32_sparc_vec,
-       &elf32_i386_vec,
-       &elf32_m68k_vec,
-       &elf32_i860_vec,
+       &bfd_elf32_sparc_vec,
+       &bfd_elf32_i386_vec,
+       &bfd_elf32_m68k_vec,
+       &bfd_elf32_i860_vec,
        &a_out_adobe_vec,
        &b_out_vec_little_host,
        &b_out_vec_big_host,