* doc/c-arm.texi: Add new fpe options to list of supported flags.
[deliverable/binutils-gdb.git] / bfd / ihex.c
index 83808ee89699d4fe2d5be834dd3f899bb4853029..8bb51349f0729f02ad3e028763f311952551e31d 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel Hex objects.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
 
@@ -123,8 +123,7 @@ The MRI compiler uses this, which is a repeat of type 5:
 #include "sysdep.h"
 #include "libbfd.h"
 #include "libiberty.h"
-
-#include <ctype.h>
+#include "safe-ctype.h"
 
 static void ihex_init PARAMS ((void));
 static boolean ihex_mkobject PARAMS ((bfd *));
@@ -140,7 +139,6 @@ static boolean ihex_set_section_contents
 static boolean ihex_write_record
   PARAMS ((bfd *, size_t, unsigned int, unsigned int, bfd_byte *));
 static boolean ihex_write_object_contents PARAMS ((bfd *));
-static asymbol *ihex_make_empty_symbol PARAMS ((bfd *));
 static boolean ihex_set_arch_mach
   PARAMS ((bfd *, enum bfd_architecture, unsigned long));
 static int ihex_sizeof_headers PARAMS ((bfd *, boolean));
@@ -249,7 +247,7 @@ ihex_bad_byte (abfd, lineno, c, error)
     {
       char buf[10];
 
-      if (! isprint (c))
+      if (! ISPRINT (c))
        sprintf (buf, "\\%03o", (unsigned int) c);
       else
        {
@@ -258,7 +256,7 @@ ihex_bad_byte (abfd, lineno, c, error)
        }
       (*_bfd_error_handler)
        (_("%s:%d: unexpected character `%s' in Intel Hex file\n"),
-        bfd_get_filename (abfd), lineno, buf);
+        bfd_archive_filename (abfd), lineno, buf);
       bfd_set_error (bfd_error_bad_value);
     }
 }
@@ -368,7 +366,7 @@ ihex_scan (abfd)
            {
              (*_bfd_error_handler)
                (_("%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"),
-                bfd_get_filename (abfd), lineno,
+                bfd_archive_filename (abfd), lineno,
                 (- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
              bfd_set_error (bfd_error_bad_value);
              goto error_return;
@@ -422,7 +420,7 @@ ihex_scan (abfd)
                {
                  (*_bfd_error_handler)
                    (_("%s:%u: bad extended address record length in Intel Hex file"),
-                    bfd_get_filename (abfd), lineno);
+                    bfd_archive_filename (abfd), lineno);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -439,7 +437,7 @@ ihex_scan (abfd)
                {
                  (*_bfd_error_handler)
                    (_("%s:%u: bad extended start address length in Intel Hex file"),
-                    bfd_get_filename (abfd), lineno);
+                    bfd_archive_filename (abfd), lineno);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -456,7 +454,7 @@ ihex_scan (abfd)
                {
                  (*_bfd_error_handler)
                    (_("%s:%u: bad extended linear address record length in Intel Hex file"),
-                    bfd_get_filename (abfd), lineno);
+                    bfd_archive_filename (abfd), lineno);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -473,7 +471,7 @@ ihex_scan (abfd)
                {
                  (*_bfd_error_handler)
                    (_("%s:%u: bad extended linear start address length in Intel Hex file"),
-                    bfd_get_filename (abfd), lineno);
+                    bfd_archive_filename (abfd), lineno);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -490,7 +488,7 @@ ihex_scan (abfd)
            default:
              (*_bfd_error_handler)
                (_("%s:%u: unrecognized ihex type %u in Intel Hex file\n"),
-                bfd_get_filename (abfd), lineno, type);
+                bfd_archive_filename (abfd), lineno, type);
              bfd_set_error (bfd_error_bad_value);
              goto error_return;
            }
@@ -610,7 +608,7 @@ ihex_read_section (abfd, section, contents)
        {
          (*_bfd_error_handler)
            (_("%s: internal error in ihex_read_section"),
-            bfd_get_filename (abfd));
+            bfd_archive_filename (abfd));
          bfd_set_error (bfd_error_bad_value);
          goto error_return;
        }
@@ -645,7 +643,7 @@ ihex_read_section (abfd, section, contents)
     {
       (*_bfd_error_handler)
        (_("%s: bad section length in ihex_read_section"),
-        bfd_get_filename (abfd));
+        bfd_archive_filename (abfd));
       bfd_set_error (bfd_error_bad_value);
       goto error_return;
     }
@@ -917,21 +915,6 @@ ihex_write_object_contents (abfd)
   return true;
 }
 
-/* Make an empty symbol.  This is required only because
-   bfd_make_section_anyway wants to create a symbol for the section.  */
-
-static asymbol *
-ihex_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new != NULL)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* Set the architecture for the output file.  The architecture is
    irrelevant, so we ignore errors about unknown architectures.  */
 
@@ -971,6 +954,7 @@ ihex_sizeof_headers (abfd, exec)
 #define ihex_get_symtab_upper_bound bfd_0l
 #define ihex_get_symtab \
   ((long (*) PARAMS ((bfd *, asymbol **))) bfd_0l)
+#define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
 #define ihex_print_symbol _bfd_nosymbols_print_symbol
 #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
 #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
This page took 0.025884 seconds and 4 git commands to generate.