Check if symbol is defined when converting mov to lea
[binutils-gdb.git] / bfd / aout-arm.c
index fd936030c3dc3d0b703bb6e1f1c5a020eadd32e2..9e5bb8fe8abdf25d402827511fa83c3b53886d64 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-2015 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
    This file is part of BFD, the Binary File Descriptor library.
 #define SEGMENT_SIZE TARGET_PAGE_SIZE
 #define DEFAULT_ARCH bfd_arch_arm
 
-#define MY(OP) CONCAT2 (aoutarm_,OP)
+#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"
@@ -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;
 
@@ -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,9 +461,9 @@ 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.  */
   bfd_target_aout_flavour,
@@ -501,12 +500,12 @@ 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.  */
   bfd_target_aout_flavour,
@@ -543,7 +542,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,
 };