This is the mail archive of the binutils@sourceware.org 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: Fix assembly of Thumb pcrel LDRs against global symbols


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.



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