This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MIPS/gas: Redefined label alignment assertion failure fix


Hi,

 As noted with the previous submission, there is an internal 
error/assertion failure seen in the "is already defined" test case.  The 
reason is a label has been (incorrectly) redefined and as a result it 
resides in a different segment to the current one, which the alignment 
operation that fails applies to.  I believe it is safe to convert the 
assertion failure to a condition around the alignment operation; as the 
redefinition has been incorrect, GAS will have failed regardless.

 The fix below removes the assertion failure making the "is already 
defined" test case behave as expected.

2009-09-12  Maciej W. Rozycki  <macro@linux-mips.org>

	* config/tc-mips.c (mips_align): Don't align the label if from 
	another segment; remove the assertion failure for same.

 Regression tested for the mipsel-linux and mips64-linux targets.  OK to 
apply to the trunk?  I suggest to propagate it to 2.20; we shouldn't be 
nourishing invalid assertion failures.

  Maciej

binutils-2.20.51-mips-gas-align-label.patch
Index: binutils-2.20.51-mipsel/gas/config/tc-mips.c
===================================================================
--- binutils-2.20.51-mipsel.orig/gas/config/tc-mips.c
+++ binutils-2.20.51-mipsel/gas/config/tc-mips.c
@@ -12469,9 +12469,8 @@ mips_align (int to, int *fill, symbolS *
   else
     frag_align (to, fill ? *fill : 0, 0);
   record_alignment (now_seg, to);
-  if (label != NULL)
+  if (label != NULL && S_GET_SEGMENT (label) == now_seg)
     {
-      gas_assert (S_GET_SEGMENT (label) == now_seg);
       symbol_set_frag (label, frag_now);
       S_SET_VALUE (label, (valueT) frag_now_fix ());
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]