This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Question on gas difference between 2.19.1 and 2.20
- From: Phil Blundell <pb at reciva dot com>
- To: Lluís Batlle <viriketo at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 03 Nov 2009 20:38:02 +0000
- Subject: Re: Question on gas difference between 2.19.1 and 2.20
- References: <45219fb00911031124n4b0546efn5b5542696dc6b54d@mail.gmail.com>
On Tue, 2009-11-03 at 20:24 +0100, LluÃs Batlle wrote:
> jumpStart:
>
> .section ".reset_vector_sect",#alloc, #execinstr
>
> /* Check if we booted from DRAM. If we did someone already */
> /* initialize the DRAM controller */
>
> adr r4, jumpStart /* r4 <- current position of
> code */ /* line 62 of the source file */
> mov r5, #~0xff
> Assembling with binutils 2.20 gas, I get:
> jump.S:62: Error: symbol .text is in a different section
>
> Does anybody understand this behaviour? Maybe I am doing something
> wrong? I don't understand the meaning of that message in this context.
I am rather surprised that binutils 2.19.1 accepted this code. What
output did it produce?
The "adr" pseudo-op is (approximately) an assembler shorthand for "add
rN, pc, #(dest - .)", i.e. it assembles to an arithmetic operation with
an immediate operand. Using adr across sections is possible in theory,
albeit with restrictions, but I don't think either GAS nor GNU ld
understand the relocation types that you would need to make it work.
p.