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]

Re: bogus test case expectations


>>> "Jan Beulich" <JBeulich@novell.com> 23.07.09 11:36 >>>
>The combined example would be:
>
>	.global foo1#, foo2#, foo3#
>	foo1# = bar1#
>	foo2# = bar2#
>	foo3# = bar3#
>	.global bar1#, bar2#, bar3#
>	.data
>bar1:
>	data4 0
>
>	.text
>	addl	r2 = @ltoffx(foo1#), gp
>	addl	r3 = @ltoffx(foo2#), gp
>	;;
>	ld8.mov r8 = [r2], foo1#
>	ld8.mov r9 = [r3], foo2#
>	addl	r2 = @ltoffx(foo3#), gp
>	;;
>	ld8.mov r8 = [r2], foo3#
>
>	.data
>bar3:
>	data4 0
>
>Perhaps the condition really needs to check for whether the to be replaced
>symbol is global? That would likely fit my current needs, as there I'm solely
>dealing with register symbols (which should never be global - the assembler
>currently allowing this without a warning seems suspicious to me). And as
>I just checked - that kind of a change not only passes the testsuite for ia64,
>it also addresses the inconsistency with the foo3/bar3 pair above (I yet
>have to look into why it still results in foo2 being used rather than bar2).

This is caused by the logic in resolve_symbol_value(), following this comment:

	  /* If we have equated this symbol to an undefined or common
	     symbol, keep X_op set to O_symbol, and don't change
	     X_add_number.  This permits the routine which writes out
	     relocation to detect this case, and convert the
	     relocation to be against the symbol to which this symbol
	     is equated.  */

I'd think this as well needs to distinguish local from global symbols, and
apply only for the former. Alan, Nick?

Jan


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