components/binutils/patches/gas.write.c.patch
author Stefan Teleman <stefan.teleman@oracle.com>
Thu, 14 Feb 2013 18:44:43 -0800
branchs11-update
changeset 2493 9911278899a3
parent 701 d5c86da1ed69
permissions -rw-r--r--
15824357 SUNBT7205968 Upgrade binutils to 2.22

--- binutils-2.23.1/gas/write.c	2011-11-21 01:29:29.000000000 -0800
+++ binutils-2.23.1/gas/write.c	2012-08-28 10:51:49.991653399 -0700
@@ -808,6 +808,22 @@
 	    sym = newsym;
 	  }
 
+	/* Also convert fx_subsy if present */
+	if (fixp->fx_subsy != NULL)
+	  {
+	    symbolS *sub_sym = fixp->fx_subsy;
+	    while (symbol_equated_reloc_p (sub_sym)
+		    || S_IS_WEAKREFR (sub_sym))
+	      {
+		symbolS *newsym = symbol_get_value_expression (sub_sym)->X_add_symbol;
+		if (sub_sym == newsym)
+		    break;
+		fixp->fx_offset -= symbol_get_value_expression (sub_sym)->X_add_number;
+		fixp->fx_subsy = newsym;
+		sub_sym = newsym;
+	      }
+	  }
+
 	if (symbol_mri_common_p (sym))
 	  {
 	    fixp->fx_offset += S_GET_VALUE (sym);