Add an extra library name template to the list used by the WIN32 targets.
[deliverable/binutils-gdb.git] / bfd / aout-arm.c
index fd936030c3dc3d0b703bb6e1f1c5a020eadd32e2..211f51f8f3baffd76a0cc43fc6245ade6a1be0c8 100644 (file)
@@ -1,6 +1,5 @@
 /* BFD back-end for raw ARM a.out binaries.
-   Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005,
-   2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -35,7 +34,7 @@
    : ((N_MAGIC (x) != ZMAGIC)                                  \
       ? (bfd_vma) 0                                            \
       : ((N_SHARED_LIB (x))                                    \
-        ? ((x).a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1))    \
+        ? ((x)->a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1))   \
         : (bfd_vma) TEXT_START_ADDR)))
 
 #define TEXT_START_ADDR 0x8000
 #define SEGMENT_SIZE TARGET_PAGE_SIZE
 #define DEFAULT_ARCH bfd_arch_arm
 
-#define MY(OP) CONCAT2 (aoutarm_,OP)
-#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) && \
-                     (((x).a_info & ~006000) != OMAGIC) && \
-                     ((x).a_info != NMAGIC))
-#define N_MAGIC(x) ((x).a_info & ~07200)
+#define MY(OP) CONCAT2 (arm_aout_,OP)
+#define N_BADMAG(x) ((((x)->a_info & ~007200) != ZMAGIC) && \
+                    (((x)->a_info & ~006000) != OMAGIC) && \
+                    ((x)->a_info != NMAGIC))
+#define N_MAGIC(x) ((x)->a_info & ~07200)
 
-#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
-#define MY_bfd_reloc_name_lookup aoutarm_bfd_reloc_name_lookup
+#define MY_bfd_reloc_type_lookup arm_aout_bfd_reloc_type_lookup
+#define MY_bfd_reloc_name_lookup arm_aout_bfd_reloc_name_lookup
 
 #include "libaout.h"
 #include "aout/aout64.h"
@@ -112,7 +111,7 @@ MY (reloc_howto) (bfd *abfd,
                       | rel->r_index[2]);
       *r_extern    = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
       r_pcrel_done = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
-      r_neg       = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_BIG));
+      r_neg       = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_BIG));
       r_length     = ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
                      >> RELOC_STD_BITS_LENGTH_SH_BIG);
     }
@@ -123,7 +122,7 @@ MY (reloc_howto) (bfd *abfd,
                      | rel->r_index[0]);
       *r_extern    = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
       r_pcrel_done = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
-      r_neg       = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_LITTLE));
+      r_neg       = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_LITTLE));
       r_length     = ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
                      >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
     }
@@ -157,7 +156,7 @@ MY (put_reloc) (bfd *abfd,
   if (howto->type == 3 || howto->type == 7)
     r_length = 3;
 
-  r_pcrel  = howto->type & 4;  /* PC Relative done?  */
+  r_pcrel  = howto->type & 4;  /* PC Relative done?  */
   r_neg = howto->type & 8;     /* Negative relocation.  */
 
   if (bfd_header_big_endian (abfd))
@@ -247,7 +246,7 @@ MY (fix_pcrel_26) (bfd *abfd,
   bfd_reloc_status_type flag = bfd_reloc_ok;
 
   /* If this is an undefined symbol, return error.  */
-  if (symbol->section == &bfd_und_section
+  if (bfd_is_und_section (symbol->section)
       && (symbol->flags & BSF_WEAK) == 0)
     return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
 
@@ -299,8 +298,8 @@ MY (bfd_reloc_type_lookup) (bfd *abfd,
     switch (bfd_arch_bits_per_address (abfd))
       {
       case 32:
-        code = BFD_RELOC_32;
-        break;
+       code = BFD_RELOC_32;
+       break;
       default:
        return NULL;
       }
@@ -409,10 +408,10 @@ MY_swap_std_reloc_out (bfd *abfd,
      check for that here.  */
 
   if (bfd_is_com_section (output_section)
-      || output_section == &bfd_abs_section
-      || output_section == &bfd_und_section)
+      || bfd_is_abs_section (output_section)
+      || bfd_is_und_section (output_section))
     {
-      if (bfd_abs_section.symbol == sym)
+      if (bfd_abs_section_ptr->symbol == sym)
        {
          /* Whoops, looked like an abs symbol, but is really an offset
             from the abs section.  */
@@ -462,21 +461,21 @@ MY_swap_std_reloc_out (bfd *abfd,
 
 #include "aout-target.h"
 
-extern const bfd_target aout_arm_big_vec;
+extern const bfd_target arm_aout_be_vec;
 
-const bfd_target aout_arm_little_vec =
+const bfd_target arm_aout_le_vec =
 {
-  "a.out-arm-little",           /* Name.  */
+  "a.out-arm-little",          /* Name.  */
   bfd_target_aout_flavour,
-  BFD_ENDIAN_LITTLE,            /* Target byte order (little).  */
-  BFD_ENDIAN_LITTLE,            /* Target headers byte order (little).  */
-  (HAS_RELOC | EXEC_P |         /* Object flags.  */
+  BFD_ENDIAN_LITTLE,           /* Target byte order (little).  */
+  BFD_ENDIAN_LITTLE,           /* Target headers byte order (little).  */
+  (HAS_RELOC | EXEC_P |                /* Object flags.  */
    HAS_LINENO | HAS_DEBUG |
    HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
   MY_symbol_leading_char,
-  AR_PAD_CHAR,                  /* AR_pad_char.  */
-  15,                           /* AR_max_namelen.  */
+  AR_PAD_CHAR,                 /* AR_pad_char.  */
+  15,                          /* AR_max_namelen.  */
   0,                           /* match priority.  */
   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
@@ -484,12 +483,25 @@ const bfd_target aout_arm_little_vec =
   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
   bfd_getl16, bfd_getl_signed_16, bfd_putl16,  /* Headers.  */
-  {_bfd_dummy_target, MY_object_p,             /* bfd_check_format.  */
-   bfd_generic_archive_p, MY_core_file_p},
-  {bfd_false, MY_mkobject,                     /* bfd_set_format.  */
-   _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, MY_write_object_contents,                /* bfd_write_contents.  */
-   _bfd_write_archive_contents, bfd_false},
+
+  {                            /* bfd_check_format.  */
+    _bfd_dummy_target,
+    MY_object_p,
+    bfd_generic_archive_p,
+    MY_core_file_p
+  },
+  {                            /* bfd_set_format.  */
+    _bfd_bool_bfd_false_error,
+    MY_mkobject,
+    _bfd_generic_mkarchive,
+    _bfd_bool_bfd_false_error
+  },
+  {                            /* bfd_write_contents.  */
+    _bfd_bool_bfd_false_error,
+    MY_write_object_contents,
+    _bfd_write_archive_contents,
+    _bfd_bool_bfd_false_error
+  },
 
   BFD_JUMP_TABLE_GENERIC (MY),
   BFD_JUMP_TABLE_COPY (MY),
@@ -501,18 +513,18 @@ const bfd_target aout_arm_little_vec =
   BFD_JUMP_TABLE_LINK (MY),
   BFD_JUMP_TABLE_DYNAMIC (MY),
 
-  & aout_arm_big_vec,
+  & arm_aout_be_vec,
 
   (void *) MY_backend_data,
 };
 
-const bfd_target aout_arm_big_vec =
+const bfd_target arm_aout_be_vec =
 {
-  "a.out-arm-big",              /* Name.  */
+  "a.out-arm-big",             /* Name.  */
   bfd_target_aout_flavour,
-  BFD_ENDIAN_BIG,               /* Target byte order (big).  */
-  BFD_ENDIAN_BIG,               /* Target headers byte order (big).  */
-  (HAS_RELOC | EXEC_P |         /* Object flags.  */
+  BFD_ENDIAN_BIG,              /* Target byte order (big).  */
+  BFD_ENDIAN_BIG,              /* Target headers byte order (big).  */
+  (HAS_RELOC | EXEC_P |                /* Object flags.  */
    HAS_LINENO | HAS_DEBUG |
    HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
@@ -526,12 +538,25 @@ const bfd_target aout_arm_big_vec =
   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
   bfd_getb16, bfd_getb_signed_16, bfd_putb16,  /* Headers.  */
-  {_bfd_dummy_target, MY_object_p,             /* bfd_check_format.  */
-   bfd_generic_archive_p, MY_core_file_p},
-  {bfd_false, MY_mkobject,                     /* bfd_set_format.  */
-   _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, MY_write_object_contents,                /* bfd_write_contents.  */
-   _bfd_write_archive_contents, bfd_false},
+
+  {                            /* bfd_check_format.  */
+    _bfd_dummy_target,
+    MY_object_p,
+    bfd_generic_archive_p,
+    MY_core_file_p
+  },
+  {                            /* bfd_set_format.  */
+    _bfd_bool_bfd_false_error,
+    MY_mkobject,
+    _bfd_generic_mkarchive,
+    _bfd_bool_bfd_false_error
+  },
+  {                            /* bfd_write_contents.  */
+    _bfd_bool_bfd_false_error,
+    MY_write_object_contents,
+    _bfd_write_archive_contents,
+    _bfd_bool_bfd_false_error
+  },
 
   BFD_JUMP_TABLE_GENERIC (MY),
   BFD_JUMP_TABLE_COPY (MY),
@@ -543,7 +568,7 @@ const bfd_target aout_arm_big_vec =
   BFD_JUMP_TABLE_LINK (MY),
   BFD_JUMP_TABLE_DYNAMIC (MY),
 
-  & aout_arm_little_vec,
+  & arm_aout_le_vec,
 
   (void *) MY_backend_data,
 };
This page took 0.029093 seconds and 4 git commands to generate.