This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Wed, 30 Mar 2011 11:28:07 +0200
- Subject: [patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE
Hi,
although I wasn't able to find this in the xcoff spec, header files are clear: the AIX linker may (and seldom does) nullify
symbol table entries by setting storage class to C_NULL and value to C_NULL_VALUE.
With this patch, bfd will silently accept these symbols instead of generating a warning.
Ok for mainline ?
Tristan.
bfd/
2011-03-30 Tristan Gingold <gingold@adacore.com>
* coffcode.h (coff_slurp_symbol_table): Silently discard C_NULL
entry on xcoff when value is C_NULL_VALUE.
include/coff/
2011-03-30 Tristan Gingold <gingold@adacore.com>
* internal.h (C_NULL_VALUE): Define.
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 0fbaa97..6ee3db9 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -4896,6 +4896,11 @@ coff_slurp_symbol_table (bfd * abfd)
&& src->u.syment.n_value == 0
&& src->u.syment.n_scnum == 0)
break;
+#ifdef RS6000COFF_C
+ /* XCOFF specific: deleted entry. */
+ if (src->u.syment.n_value == C_NULL_VALUE)
+ break;
+#endif
/* Fall through. */
case C_EXTDEF: /* External definition. */
case C_ULABEL: /* Undefined label. */
diff --git a/include/coff/internal.h b/include/coff/internal.h
index a6ead9e..f52bfbb 100644
--- a/include/coff/internal.h
+++ b/include/coff/internal.h
@@ -320,6 +320,8 @@ struct internal_aouthdr
#define C_EINCL 109 /* Marks ending of include file */
#define C_AIX_WEAKEXT 111 /* AIX definition of C_WEAKEXT. */
+#define C_NULL_VALUE 0x00de1e00 /* Value for a C_NULL deleted entry. */
+
#if defined _AIX52 || defined AIX_WEAK_SUPPORT
#undef C_WEAKEXT
#define C_WEAKEXT C_AIX_WEAKEXT