Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
[deliverable/binutils-gdb.git] / bfd / coff-arm.c
index 98b5635e0f43753100253d55c388d211b6d362c6..a33bbb229b10030b27d2a6d13b0393d8df6c27c9 100644 (file)
@@ -1,4 +1,4 @@
-/* BFD back-end for Intel arm COFF files.
+/* BFD back-end for ARM COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -259,12 +259,24 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
        0xffffffff,
        PCRELOFFSET),
 };
+#ifdef COFF_WITH_PE
+/* Return true if this relocation should
+   appear in the output .reloc section. */
+
+static boolean in_reloc_p (abfd, howto)
+     bfd * abfd;
+     reloc_howto_type *howto;
+{
+  return !howto->pc_relative && howto->type != 11;
+}     
+#endif
 
 
 #define RTYPE2HOWTO(cache_ptr, dst) \
            (cache_ptr)->howto = aoutarm_std_reloc_howto + (dst)->r_type;
 
 #define coff_rtype_to_howto coff_arm_rtype_to_howto
+
 static reloc_howto_type *
 coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
      bfd *abfd;
@@ -280,9 +292,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
 
   if (rel->r_type == 11)
     {
-      /* Gross, where can I get this from ?? */
-      struct bfd_link_info *link_info = coff_data(sec->output_section->owner)->link_info;
-      *addendp -= link_info->pe_info->image_base.value;
+      *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
     }
   return howto;
 
@@ -409,12 +419,21 @@ arm_reloc_type_lookup(abfd,code)
 /* We use the special COFF backend linker.  */
 #define coff_relocate_section _bfd_coff_generic_relocate_section
 
+
 #include "coffcode.h"
 
+const bfd_target
 #ifdef TARGET_LITTLE_SYM
-const bfd_target TARGET_LITTLE_SYM =
+TARGET_LITTLE_SYM =
+#else
+armcoff_little_vec =
+#endif
 {
-  TARGET_LITTLE_NAME,          /* name or coff-arm-little */
+#ifdef TARGET_LITTLE_NAME
+  TARGET_LITTLE_NAME,
+#else
+  "coff-arm-little",
+#endif
   bfd_target_coff_flavour,
   false,                       /* data byte order is little */
   false,                       /* header byte order is little */
@@ -432,7 +451,6 @@ const bfd_target TARGET_LITTLE_SYM =
   '/',                         /* ar_pad_char */
   15,                          /* ar_max_namelen */
 
-  2,                           /* minimum alignment power */
   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
@@ -460,12 +478,19 @@ const bfd_target TARGET_LITTLE_SYM =
 
   COFF_SWAP_TABLE,
 };
-#endif
 
+const bfd_target
 #ifdef TARGET_BIG_SYM
-const bfd_target TARGET_BIG_SYM =
+TARGET_BIG_SYM =
+#else
+armcoff_big_vec =
+#endif
 {
-  TARGET_BIG_NAME,             /* name or coff-arm-big */
+#ifdef TARGET_BIG_NAME
+  TARGET_BIG_NAME,
+#else
+  "coff-arm-big",
+#endif
   bfd_target_coff_flavour,
   true,                                /* data byte order is big */
   true,                                /* header byte order is big */
@@ -483,7 +508,6 @@ const bfd_target TARGET_BIG_SYM =
   '/',                         /* ar_pad_char */
   15,                          /* ar_max_namelen */
 
-  2,                           /* minimum alignment power */
   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 */
@@ -511,4 +535,3 @@ const bfd_target TARGET_BIG_SYM =
 
   COFF_SWAP_TABLE,
 };
-#endif
This page took 0.024296 seconds and 4 git commands to generate.