This is the mail archive of the 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

>>> "H.J. Lu" <> 22.07.09 23:21 >>>
>On Wed, Jul 22, 2009 at 4:46 AM, Jan Beulich<> wrote:
>> As it stands we don't change *symbolPP if the supposed replacement symbol
>> is defined, which looks wrong even outside of the use that I encountered
>> the problem with.
>Please take a look at
>again. "foo = bar" just makes a new symbol, foo, with value
>and type of symbol, bar. We should never replace relocations
>against "foo" with relocations against "bar" since other properties
>of "foo" and "bar" may be very different.

I understand the goal, but disagree with how you (try to) achieve it. In
particular, your statement above has *nothing* to do with whether a
symbol is defined - for undefined symbols, you'd want the same behavior.
And indeed, if I just remove the definition of bar from that example, the
relocation all of the sudden no longer uses foo, but bar. And even worse,
when I move the definition past the use, the two relocations use foo and
bar each once.

The combined example would be:

	.global foo1#, foo2#, foo3#
	foo1# = bar1#
	foo2# = bar2#
	foo3# = bar3#
	.global bar1#, bar2#, bar3#
	data4 0

	addl	r2 = @ltoffx(foo1#), gp
	addl	r3 = @ltoffx(foo2#), gp
	;; r8 = [r2], foo1# r9 = [r3], foo2#
	addl	r2 = @ltoffx(foo3#), gp
	;; r8 = [r2], foo3#

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


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