This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix assembly of Thumb pcrel LDRs against global symbols
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Richard Sandiford <richard dot sandiford at linaro dot org>
- Cc: binutils at sourceware dot org, patches at linaro dot org
- Date: Wed, 02 Mar 2011 15:18:09 +0000
- Subject: Re: Fix assembly of Thumb pcrel LDRs against global symbols
- References: <g4tyfoxqlj.fsf@linaro.org>
On Mon, 2011-02-28 at 12:59 +0000, Richard Sandiford wrote:
> The PC-relative LDR instructions have no associated relocation,
> so even LDRs for global symbols should be resolved by the assembler.
> We currently handle this correctly for single-register ARM loads,
> but we're missing the associated relocation types for LDRD and Thumb.
> This leads to errors like:
I'm not sure I agree with this. If I write
.global foo
...
ldr r0, foo
...
foo:
...
but then at link/load time pre-empt foo with some other definition, that
will silently leave me with the wrong answer.
It's clearly OK to do this if foo is protected or private, but not
otherwise.
The existing error message is not very informative as to what the
problem is, but I'm not sure I agree with your solution...
R.