This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ARM]ÂWrong BLX destination
- From: Nick Clifton <nickc at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, binutils at sourceware dot org
- Date: Wed, 9 Mar 2016 13:49:06 +0000
- Subject: Re: [ARM]ÂWrong BLX destination
- Authentication-results: sourceware.org; auth=none
- References: <e6e780968ce73fee4b9437f43c2bb110 at simark dot ca>
Hi Simon,
> I then tried to do the same thing, except I placed the target symbols in
> another compilation unit
>
> .arm
> .align 4
>
> blx hello1
> blx hello2
> blx hello3
>
> # Space things out a bit
> .fill 20, 4, 0
>
> and test2.S with the labels:
>
> .arm
> .global hello1
> .global hello2
> .global hello3
>
> hello1:
> .hword 0x1111
>
> hello2:
> .hword 0x2222
>
> hello3:
> .hword 0x3333
>
> # Space things out a bit
> .fill 20, 4, 0
>
> This is the resulting disassembly:
>
> 83d0: fa000016 blx 8430 <hello1>
> 83d4: fa000015 blx 8430 <hello1> <---- WRONG TARGET
> 83d8: fa000015 blx 8434 <hello3>
> Do you know if this is the intended behavior,
Yes...
> and if so, what explains it?
The fact that your test2.S file claims to be an ARM assembler source file (via
the .arm pseudo-op) and so, by inference, all of the symbols in it are ARM
symbols and not THUMB symbols.
If you change test2.S so that it starts with:
.thumb
then your test will work.
Cheers
Nick