This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: "Unsupported Relocation Against" error when using la instruction with string
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Bradley Remedios <bremedios at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 03 Dec 2004 20:25:15 -0500
- Subject: Re: "Unsupported Relocation Against" error when using la instruction with string
- References: <963b33870412031454315ccadf@mail.gmail.com>
Bradley Remedios <bremedios@gmail.com> writes:
> /* This is a Null-Terminated String that I want to pass to
> a function in assembler that accepts the address of a
> string in a register (r9)
> */
> _my_text:
> .ascii "My Null Terminated String\n\o"
>
> /* I would expect this to load the address of _my_text
> into r9. This Line actualy gives me the erroor.
> */
> la r9, _my_text(r0)
Why are you using _my_text as an index off of r0? That won't work.
_my_text is an absolute address, not an offset.
I recommend that you compile some simple C code with -S, and look at
how this sort of thing is handled by the C compiler.
Ian