Fix regression from change
authorWalter Lee <walt@tilera.com>
Sat, 25 Feb 2012 22:40:48 +0000 (22:40 +0000)
committerWalter Lee <walt@tilera.com>
Sat, 25 Feb 2012 22:40:48 +0000 (22:40 +0000)
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.

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

gas/ChangeLog
gas/config/tc-tilegx.c
gas/config/tc-tilepro.c

index 5e5f50b36e34c4d8f49de18d1a3e770e148e696a..6e6f70a5bae04a93dccea7da2ac7acccf024a3a5 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-25  Walter Lee  <walt@tilera.com>
+
+       * tc-tilepro.c (emit_tilepro_instruction): Check if symbol is
+       non-local before checking sy_value.
+       * tc-tilegx.c (emit_tilegx_instruction): Ditto.
+
 2012-02-25  Walter Lee  <walt@tilera.com>
 
        * tc-tilepro.c (O_tls_le): Define operator.
index eda36c0d18c9a14be56dbe6cddd0272f955fa7ed..b2d94205be1a06752015e159bcf48b83e88a9281 100644 (file)
@@ -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
index 0b378c2f197543dae7c5a57ec61117e2a3053d80..733a628f209fd12580c81106cc3690f450a3855b 100644 (file)
@@ -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