This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: arm/thumb: GOT and indirections
- From: Adrian von Bidder <avbidder at acter dot ch>
- To: gcc devel mailing list <gcc at gcc dot gnu dot org>
- Date: 16 Jan 2002 11:06:36 +0100
- Subject: Re: arm/thumb: GOT and indirections
- References: <1011112433.30239.15.camel@atlas>
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