xjag74 <detlef.weidner@...> schrieb am Mon, 11 Jul 2005 15:00:32
-0000:
> Hi,
>
> I wonder why GCC don't compile that simple code:
>
> static inline unsigned StackPointerValue(void)
> {
> unsigned long val;
> asm volatile (" str R13, retval");
> return val;
> }
>
> When I try to compile the following error appears:
> "Internal_relocation (type: OFFSET_IMM) not fixed up"
gcc (or better gas) does not know anything about retval, so it takes it
as external and gets confused.
This works:
long sp(void)
{
long val;
asm(" mov %r0,sp":"=r"(val));
return val;
}
>
> What does that mean? How can I get that running?
>
> Best regards
> XJAG74
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
--
42Bastian SchickMessage
Re: [lpc2000] GNU inline assembler return value
2005-07-11 by 42Bastian Schick