This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Thumb inline assembly
- From: Ian Lance Taylor <iant at google dot com>
- To: Kalai Rajah N <kalairajah at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 10 Jun 2013 15:51:26 -0700
- Subject: Re: Thumb inline assembly
- References: <CAPTDLfFZp2Z_arQO0iRRFFQMxuj1=AC6zxgv4Q=F2GVxY23qVA at mail dot gmail dot com>
On Mon, Jun 10, 2013 at 2:41 PM, Kalai Rajah N <kalairajah@gmail.com> wrote:
> I'm trying to do a simple register read through ARM inline assembly.
> If I embed the asm in the function directly, it works ...
...
> I see the following errors:
> /tmp/ccYu7aUS.ltrans0.ltrans.o: In function `read_reg_ok':
> ccYu7aUS.ltrans0.o:(.text.check_reset_value.4010+0x60): undefined
> reference to `r6'
> ccYu7aUS.ltrans0.o:(.text.check_reset_value.4010+0x64): undefined
> reference to `r4'
> ccYu7aUS.ltrans0.o:(.text.check_reset_value.4010+0x68): undefined
> reference to `r5'
> collect2: error: ld returned 1 exit status
>
> What am I doing wrong?
Your test case has no mention of r4, r5, or r6. It always helps to
show a complete standalone test case.
The error messages indicate some confusion: there are references to
symbols using the names of registers. But I don't know where those
are coming from.
Ian