On 12/16/2015 10:13 AM, Jonas Maebe wrote:
>> The compiler and assembler mark which code is ARM and which is Thumb. 
>> Normally, when the linker processes the object files, it will replace 
>> the blx instructions with bl if they go from ARM to ARM or from Thumb 
>> to Thumb. The reason that a compiler/assembler cannot do this, is that 
>> the target of a call may be in another object file and the 
>> compiler/assembler cannot know whether this object file has been 
>> compiled in ARM or Thumb mode.
>>
>> Are you not processing the generated code with a linker at all?
>>
>>
>> Jonas
>Just adding to Jonas's answer here.
>
>While it's true that BLX always changes instructions set, I've heard some 
>reports indicating that some assembler/linker combinations on OSX (apparently 
>clang based?) have been behaving >strangely with this lately.
>GCC+binutils have always been following the "emit blx and let the linker
>fix it" recipe, just as fpc does.
>
>Best Regards,
>Jeppe

I'm certainly using both as and ld (both arm-none-eabi for Win32 from 
launchpad.net) to produce the binary. The linker outputs an elf and I modified 
the MakeExecutable method in the compiler to do an objcopy after the linker to 
obtain a binary image. I also get it to do objdump on the elf to produce a list 
file which is where I see the blx <label> appearing.

I'll do some more searching based on the additional information from Jeppe to 
see if there is maybe a reported issue or an additional linker switch or 
something that is required.

Thanks for the info.

Garry.


_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to