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: latest ld not inserting arm interworking shims?


On Mon, Mar 12, 2012 at 5:44 PM, Richard Earnshaw <rearnsha@arm.com> wrote:
> On 10/03/12 17:36, Dave Murphy wrote:
>> Hi,
>>
>> 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) 2.22.52.20120310
>> 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
>> 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'.
>
> R.

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
-march=armv4t

Dave


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