public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE
@ 2011-03-30  9:28 Tristan Gingold
  2011-03-30 16:00 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Tristan Gingold @ 2011-03-30  9:28 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE
  2011-03-30  9:28 [patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE Tristan Gingold
@ 2011-03-30 16:00 ` Nick Clifton
  2011-03-31  8:20   ` Tristan Gingold
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2011-03-30 16:00 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: binutils

Hi 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.

Approved - please apply.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE
  2011-03-30 16:00 ` Nick Clifton
@ 2011-03-31  8:20   ` Tristan Gingold
  0 siblings, 0 replies; 3+ messages in thread
From: Tristan Gingold @ 2011-03-31  8:20 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils


On Mar 30, 2011, at 6:00 PM, Nick Clifton wrote:

> Hi 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.
> 
> Approved - please apply.

Thanks, committed.

Tristan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-31  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30  9:28 [patch] xcoff: silently ignore C_NULL symbol whose value is C_NULL_VALUE Tristan Gingold
2011-03-30 16:00 ` Nick Clifton
2011-03-31  8:20   ` Tristan Gingold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).