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: [ARM]ÂWrong BLX destination


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


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