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


On 9 March 2016 at 16:45, Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2016-03-09 08:49, Nick Clifton wrote:
>>
>> Hi Simon,
>>>
>>> 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.
>
>
> Changing only .arm to .thumb in test2.S does not change the result.  I still
> have
>
.thumb tells the assembler that the following instructions should be
encoded in thumb mode.

>     8220:       fa000015        blx     827c <hello1>
>     8224:       fa000014        blx     827c <hello1>
>     8228:       fa000014        blx     8280 <hello3>
>
> As mentioned in my other reply, adding .thumb_func before the helloX
.thumb_func tells the assembler that the next symbol is a function
written in thumb mode (but does not change the parsing mode IIRC)
This is used by the linker when resolving relocations.

> definitions changed the result to make indirect calls through
> __helloX_from_arm.
>
> Thanks,
>
> Simon


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