components/binutils/patches/gas.write.c.patch
author Jiri Sasek <Jiri.Sasek@Oracle.COM>
Wed, 06 Nov 2013 04:08:10 -0800
changeset 1538 9babd0ede872
parent 1123 cb43164c5dd1
permissions -rw-r--r--
17621167 Update samba to 3.6.19 release to address a known Winbindd issue

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