This is the mail archive of the binutils@sources.redhat.com 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]

Committed, MMIX: Initialize GREG-allocated data.


The patch fixes the following testsuite failures on
sparc-sun-solaris2.8.  Gas was emitting garbage for
.MMIX.reg_contents in some cases.  It wasn't visible on
i686-pc-linux-gnu because the data was zero for one reason or
another.  Valgrind agrees that the data is uninitialized though
(with no problems reported with the fix applied).  I vaguely
remember seeing these failures on some FreeBSD system also at
one time, but ran out of time to debug it at the time I had
access.

FAIL: gas/mmix/basep-10
FAIL: gas/mmix/basep-9
FAIL: gas/mmix/fb-2
FAIL: gas/mmix/greg1a
FAIL: gas/mmix/greg2a
FAIL: gas/mmix/prefix3

	* config/tc-mmix.c (md_convert_frag) <case STATE_GREG_DEF>:
	Initialize target of fixup to zero.

Index: config/tc-mmix.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mmix.c,v
retrieving revision 1.10
diff -p -c -r1.10 tc-mmix.c
*** config/tc-mmix.c	23 Oct 2002 05:21:09 -0000	1.10
--- config/tc-mmix.c	10 Nov 2002 12:38:06 -0000
*************** md_convert_frag (abfd, sec, fragP)
*** 2341,2346 ****
--- 2341,2350 ----
      case STATE_GREG_DEF:
        if (fragP->tc_frag_data == NULL)
  	{
+ 	  /* We must initialize data that's supposed to be "fixed up" to
+ 	     avoid emitting garbage, because md_apply_fix3 won't do
+ 	     anything for undefined symbols.  */
+ 	  md_number_to_chars (var_partp, 0, 8);
  	  tmpfixP
  	    = fix_new (fragP, var_partp - fragP->fr_literal, 8,
  		       fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_64);

brgds, H-P


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