This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH]: Sparc GOTDATA support.


From: Jakub Jelinek <jakub@redhat.com>
Date: Wed, 17 Feb 2010 00:27:43 +0100

> On Tue, Feb 16, 2010 at 03:11:30PM -0800, David Miller wrote:
>> Here is an example 32-bit GOTDATA code sequence:
>> 
>> 	.data
>> local_sym:	.word 0
>> 
>> 	.text
>> local_addr:
>> 	save	%sp, -128, %sp
>> 	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
>> pc:	call	1f
>> 	 or	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
>> 	 add	%l7, %o7, %l7
>> 	/* GOTDATA_OP sequence */
>> 	sethi	%gdop_hix22(local_sym), %l1
>> 	or	%l1, %gdop_lox10(local_sym), %l1
> 
> Isn't this supposed to be xor instead?

Right and that's what the code should do too, I typed this example
in by hand  :-)

>>  
>> +    gcc_GAS_CHECK_FEATURE([GOTDATA_OP relocs],
>> +      gcc_cv_as_sparc_gotdata_op,,
>> +      [-K PIC],
>> +[.text
>> +foo:
>> +	nop
>> +bar:
>> +	sethi %gdop_hix22(foo), %g1
>> +	or    %g1, %gdop_lox10(foo), %g1
> 
> and more importantly here as well?
> For 32-bit code it doesn't matter so much, but for 64-bit it should.

Thanks for catching this.  However, for the configure check just
making sure the relocations are supported, it isn't so critical to
use 'xor' here.

The code emitters in the sparc backend parts of the patch do use XOR
properly.

But, nevertheless, I'll fix that.


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