Set bfd_error to no_symbols if the symbols could not be read.
[deliverable/binutils-gdb.git] / bfd / m68klinux.c
index 3e14781e6be5927f25218ac049b3c4ac1d42dc99..863a61d68f822226f3630093eb0c3ada2c19d001 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for linux flavored m68k a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -37,7 +37,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define TARGET_IS_BIG_ENDIAN_P
 #define DEFAULT_ARCH bfd_arch_m68k
-#define MY(OP) CAT(m68klinux_,OP)
+
+/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
+   remove whitespace added here, and thus will fail to concatenate
+   the tokens.  */
+#define MY(OP) CONCAT2 (m68klinux_,OP)
 #define TARGETNAME "a.out-m68k-linux"
 
 extern const bfd_target MY(vec);
@@ -226,7 +230,7 @@ linux_link_hash_table_create (abfd)
   struct linux_link_hash_table *ret;
   bfd_size_type amt = sizeof (struct linux_link_hash_table);
 
-  ret = (struct linux_link_hash_table *) bfd_alloc (abfd, amt);
+  ret = (struct linux_link_hash_table *) bfd_malloc (amt);
   if (ret == (struct linux_link_hash_table *) NULL)
     {
       bfd_set_error (bfd_error_no_memory);
@@ -438,6 +442,9 @@ linux_tally_symbols (h, data)
   struct linux_link_hash_entry *h1, *h2;
   boolean exists;
 
+  if (h->root.root.type == bfd_link_hash_warning)
+    h = (struct linux_link_hash_entry *) h->root.root.u.i.link;
+
   if (h->root.root.type == bfd_link_hash_undefined
       && strncmp (h->root.root.root.string, NEEDS_SHRLIB,
                  sizeof NEEDS_SHRLIB - 1) == 0)
@@ -594,13 +601,12 @@ bfd_m68klinux_size_dynamic_sections (output_bfd, info)
     {
       s->_raw_size = linux_hash_table (info)->fixup_count + 1;
       s->_raw_size *= 8;
-      s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size);
       if (s->contents == NULL)
        {
          bfd_set_error (bfd_error_no_memory);
          return false;
        }
-      memset (s->contents, 0, (size_t) s->_raw_size);
     }
 
   return true;
This page took 0.023915 seconds and 4 git commands to generate.