* config.bfd: Mark arm-*-oabi and thumb-*-oabi as obsolete.
[deliverable/binutils-gdb.git] / bfd / cpu-arm.c
index 17889f3b4726dc5b0c74634447811762cbf8ec81..ea923c3409f35a082c1877d73d18a5adf316f6b7 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD support for the ARM processor
-   Copyright 1994, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -194,9 +195,8 @@ bfd_arm_merge_machines (ibfd, obfd)
           && (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt))
     {
       _bfd_error_handler (_("\
-ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"),
-                         bfd_archive_filename (ibfd),
-                         bfd_get_filename (obfd));
+ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
+                         ibfd, obfd);
       bfd_set_error (bfd_error_wrong_format);
       return FALSE;
     }
@@ -204,9 +204,8 @@ ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"),
           && (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt))
     {
       _bfd_error_handler (_("\
-ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"),
-                         bfd_archive_filename (obfd),
-                         bfd_get_filename (ibfd));
+ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
+                         obfd, ibfd);
       bfd_set_error (bfd_error_wrong_format);
       return FALSE;
     }
@@ -286,7 +285,7 @@ bfd_arm_update_notes (abfd, note_section)
 {
   asection *     arm_arch_section;
   bfd_size_type  buffer_size;
-  char *         buffer;
+  bfd_byte *     buffer;
   char *         arch_string;
   char *         expected;
 
@@ -298,16 +297,11 @@ bfd_arm_update_notes (abfd, note_section)
   if (arm_arch_section == NULL)
     return TRUE;
 
-  buffer_size = arm_arch_section->_raw_size;
+  buffer_size = arm_arch_section->size;
   if (buffer_size == 0)
     return FALSE;
 
-  buffer = bfd_malloc (buffer_size);
-  if (buffer == NULL)
-    return FALSE;
-  
-  if (! bfd_get_section_contents (abfd, arm_arch_section, buffer,
-                                 (file_ptr) 0, buffer_size))
+  if (!bfd_malloc_and_get_section (abfd, arm_arch_section, &buffer))
     goto FAIL;
 
   /* Parse the note.  */
@@ -351,7 +345,8 @@ bfd_arm_update_notes (abfd, note_section)
   return TRUE;
 
  FAIL:
-  free (buffer);
+  if (buffer != NULL)
+    free (buffer);
   return FALSE;
 }
 
@@ -385,7 +380,7 @@ bfd_arm_get_mach_from_notes (abfd, note_section)
 {
   asection *     arm_arch_section;
   bfd_size_type  buffer_size;
-  char *         buffer;
+  bfd_byte *     buffer;
   char *         arch_string;
   int            i;
 
@@ -397,16 +392,11 @@ bfd_arm_get_mach_from_notes (abfd, note_section)
   if (arm_arch_section == NULL)
     return bfd_mach_arm_unknown;
 
-  buffer_size = arm_arch_section->_raw_size;
+  buffer_size = arm_arch_section->size;
   if (buffer_size == 0)
     return bfd_mach_arm_unknown;
 
-  buffer = bfd_malloc (buffer_size);
-  if (buffer == NULL)
-    return bfd_mach_arm_unknown;
-  
-  if (! bfd_get_section_contents (abfd, arm_arch_section, buffer,
-                                 (file_ptr) 0, buffer_size))
+  if (!bfd_malloc_and_get_section (abfd, arm_arch_section, &buffer))
     goto FAIL;
 
   /* Parse the note.  */
@@ -422,6 +412,7 @@ bfd_arm_get_mach_from_notes (abfd, note_section)
       }
 
  FAIL:
-  free (buffer);
+  if (buffer != NULL)
+    free (buffer);
   return bfd_mach_arm_unknown;
 }
This page took 0.024775 seconds and 4 git commands to generate.