public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [commited] TILE-Gx/TILEPro: gas fix for accessing non-local symbol field
@ 2012-02-25 22:42 Walter Lee
  0 siblings, 0 replies; only message in thread
From: Walter Lee @ 2012-02-25 22:42 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

This patch fixes a regression from change
http://sourceware.org/ml/binutils-cvs/2012-01/msg00049.html .  The
code needs to check that the symbol is not a local symbol before
accessing a non-local-symbol field.  The patch has been tested
natively on both architectures and fixes the regression from that
change.

Walter

	* tc-tilepro.c (emit_tilepro_instruction): Check if symbol is
	non-local before checking sy_value.
	* tc-tilegx.c (emit_tilegx_instruction): Ditto.


[-- Attachment #2: 04.patch.txt --]
[-- Type: text/plain, Size: 1246 bytes --]

diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
index eda36c0..b2d9420 100644
--- a/gas/config/tc-tilegx.c
+++ b/gas/config/tc-tilegx.c
@@ -715,7 +715,8 @@ emit_tilegx_instruction (tilegx_bundle_bits bits,
 	      /* Now that we've changed the reloc, change ha16(x) into x,
 		 etc.  */
 
-	      if (operand_exp->X_add_symbol->sy_value.X_md)
+	      if (!operand_exp->X_add_symbol->sy_flags.sy_local_symbol
+                  && operand_exp->X_add_symbol->sy_value.X_md)
 		{
 		  /* HACK: We used X_md to mark this symbol as a fake wrapper
 		     around a real expression. To unwrap it, we just grab its
diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c
index 0b378c2..733a628 100644
--- a/gas/config/tc-tilepro.c
+++ b/gas/config/tc-tilepro.c
@@ -631,7 +631,8 @@ emit_tilepro_instruction (tilepro_bundle_bits bits,
 	      /* Now that we've changed the reloc, change ha16(x) into x,
 		 etc.  */
 
-	      if (operand_exp->X_add_symbol->sy_value.X_md)
+	      if (!operand_exp->X_add_symbol->sy_flags.sy_local_symbol
+                  && operand_exp->X_add_symbol->sy_value.X_md)
 		{
 		  /* HACK: We used X_md to mark this symbol as a fake wrapper
 		     around a real expression. To unwrap it, we just grab its

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-25 22:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-25 22:42 [commited] TILE-Gx/TILEPro: gas fix for accessing non-local symbol field Walter Lee

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