2002-06-07 Chris Demetriou <cgd@broadcom.com>
[deliverable/binutils-gdb.git] / bfd / i386linux.c
index 783951f3eb025aac29f83acdf7457052055129e6..c144822ac2a26ca1f1ca13c97140f264fad1f45e 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for linux flavored i386 a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -36,7 +36,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "libaout.h"           /* BFD a.out internal data structures */
 
 #define DEFAULT_ARCH bfd_arch_i386
-#define MY(OP) CAT(i386linux_,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 (i386linux_,OP)
 #define TARGETNAME "a.out-i386-linux"
 
 extern const bfd_target MY(vec);
@@ -434,6 +438,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)
@@ -590,10 +597,9 @@ bfd_i386linux_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)
        return false;
-      memset (s->contents, 0, (size_t) s->_raw_size);
     }
 
   return true;
This page took 0.024186 seconds and 4 git commands to generate.