This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: "Unsupported Relocation Against" error when using la instruction with string


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


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