This is the mail archive of the gcc@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: arm/thumb: GOT and indirections


On Tue, 2002-01-15 at 17:33, Adrian von Bidder wrote:
> Heyho!
> 
> this simple C program:
> main(){ 
> 	foo("hello george!\n");
> }
> 
> compiled with gcc 3.0.3 for arm and -fpic -mthumb produces:
> [...]
>    2:	4803      	ldr	r0, [pc, #12]	(10 <main+0x10>)
>    4:	5831      	ldr	r1, [r6, r0]
>    6:	6808      	ldr	r0, [r1, #0]
>    8:	fffef7ff 	bl	0 <main>
> 			8: R_ARM_THM_PC22	foo
> [...]
> 
> (-msingle-pic-base and optimization do not seem to matter).
> first ldr loads offset into GOT table.
> second ldr loads address of the string into r1
> third ldr loads first word of the string into r0. Huh!?!?!?!?

Ok, here I am again.

this is not fixed with gcc-3.1. I'll file a proper bug report in a few
moments.

greets from Zürich
-- vbi


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