* Makefile.am (libbfd.h): Add "Extracted from.." comment.
[deliverable/binutils-gdb.git] / bfd / coff-sparc.c
index a2e33e4f625e8785506bd8a88b7b2435ad9c86ae..35c23df521f6f83adf502a992d9c452d4b162da2 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Sparc COFF files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -33,11 +33,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* The page size is a guess based on ELF.  */
 #define COFF_PAGE_SIZE 0x10000
 
+
+static reloc_howto_type *coff_sparc_reloc_type_lookup
+  PARAMS ((bfd *, bfd_reloc_code_real_type));
+static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
+
 enum reloc_type
   {
     R_SPARC_NONE = 0,
-    R_SPARC_8,         R_SPARC_16,             R_SPARC_32, 
-    R_SPARC_DISP8,     R_SPARC_DISP16,         R_SPARC_DISP32, 
+    R_SPARC_8,         R_SPARC_16,             R_SPARC_32,
+    R_SPARC_DISP8,     R_SPARC_DISP16,         R_SPARC_DISP32,
     R_SPARC_WDISP30,   R_SPARC_WDISP22,
     R_SPARC_HI22,      R_SPARC_22,
     R_SPARC_13,                R_SPARC_LO10,
@@ -52,7 +57,7 @@ enum reloc_type
   };
 
 #if 0
-static CONST char *CONST reloc_type_names[] =
+static const char *const reloc_type_names[] =
 {
   "R_SPARC_NONE",
   "R_SPARC_8",         "R_SPARC_16",           "R_SPARC_32",
@@ -96,7 +101,7 @@ bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section,
   return bfd_reloc_continue;
 }
 
-static reloc_howto_type coff_sparc_howto_table[] = 
+static reloc_howto_type coff_sparc_howto_table[] =
 {
   HOWTO(R_SPARC_NONE,    0,0, 0,false,0,complain_overflow_dont,    bfd_coff_generic_reloc,"R_SPARC_NONE",    false,0,0x00000000,true),
   HOWTO(R_SPARC_8,       0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8",       false,0,0x000000ff,true),
@@ -129,7 +134,7 @@ struct coff_reloc_map {
   unsigned char coff_reloc_val;
 };
 
-static CONST struct coff_reloc_map sparc_reloc_map[] =
+static const struct coff_reloc_map sparc_reloc_map[] =
 {
   { BFD_RELOC_NONE, R_SPARC_NONE, },
   { BFD_RELOC_16, R_SPARC_16, },
@@ -183,8 +188,8 @@ rtype2howto (cache_ptr, dst)
 
 #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
 
-#define SWAP_IN_RELOC_OFFSET   bfd_h_get_32
-#define SWAP_OUT_RELOC_OFFSET  bfd_h_put_32
+#define SWAP_IN_RELOC_OFFSET   H_GET_32
+#define SWAP_OUT_RELOC_OFFSET  H_PUT_32
 #define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
   cache_ptr->addend = reloc.r_offset;
 
@@ -197,61 +202,18 @@ rtype2howto (cache_ptr, dst)
 
 #define __A_MAGIC_SET__
 
-/* Enable Sparc-specific hacks in coffcode.h. */
+/* Enable Sparc-specific hacks in coffcode.h.  */
 
 #define COFF_SPARC
 
 #include "coffcode.h"
 
-const bfd_target
-#ifdef TARGET_SYM
-  TARGET_SYM =
-#else
-  sparccoff_vec =
+#ifndef TARGET_SYM
+#define TARGET_SYM sparccoff_vec
 #endif
-{
-#ifdef TARGET_NAME
-  TARGET_NAME,
-#else
-  "coff-sparc",                        /* name */
-#endif
-  bfd_target_coff_flavour,
-  BFD_ENDIAN_BIG,      /* data byte order is big */
-  BFD_ENDIAN_BIG,      /* header byte order is big */
-
-  (HAS_RELOC | EXEC_P |                /* object flags */
-   HAS_LINENO | HAS_DEBUG |
-   HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
 
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-  '_',                         /* leading underscore */
-  '/',                         /* ar_pad_char */
-  15,                          /* ar_max_namelen */
-
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
-/* Note that we allow an object file to be treated as a core file as well. */
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
-
-     BFD_JUMP_TABLE_GENERIC (coff),
-     BFD_JUMP_TABLE_COPY (coff),
-     BFD_JUMP_TABLE_CORE (_bfd_nocore),
-     BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
-     BFD_JUMP_TABLE_SYMBOLS (coff),
-     BFD_JUMP_TABLE_RELOCS (coff),
-     BFD_JUMP_TABLE_WRITE (coff),
-     BFD_JUMP_TABLE_LINK (coff),
-     BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+#ifndef TARGET_NAME
+#define TARGET_NAME "coff-sparc"
+#endif
 
-  COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL)
This page took 0.027996 seconds and 4 git commands to generate.