This is the mail archive of the
mailing list for the binutils project.
Re: latest ld not inserting arm interworking shims?
On Mon, Mar 12, 2012 at 5:44 PM, Richard Earnshaw <firstname.lastname@example.org> wrote:
> On 10/03/12 17:36, Dave Murphy wrote:
>> I've recently managed to track down a problem with some code that
>> turned out to be ld from binutils 2.22 (both release and CVS HEAD) not
>> inserting a shin when calling arm code from thumb. Has something
>> changed recently in how the linker is used for this situation or is
>> this a bug? Binutils 2.21.1 behaves as I'd expect.
>> monalisa:interworktest davem$ arm-eabi-ld --version
>> GNU ld (GNU Binutils) 184.108.40.20620310
>> Copyright 2012 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms of
>> the GNU General Public License version 3 or (at your option) a later version.
>> This program has absolutely no warranty.
>> monalisa:interworktest davem$ cat armasm.s
>> ? ? ? .arm
>> ? ? ? .global armasm
>> ? ? ? bx ? ? ?lr
> This is wrong, you need to mark 'armasm' as being a function entry
> point. ?ie, you need to add
> ? ? ? ?.type armasm, %function
> The linker only inserts interworking veneers at points where the ABI
> says it is safe to do so (as, amongst other things, to put them in at
> other times might corrupt registers containing live values). ?Such
> permission is only granted to symbols which are marked as type 'function'.
Thanks Richard, that wasn't quite enough to get the shims back though,
I had to also specify the architecture when linking, in my case