Hi, I just met a possible bug in binutils 2.20.1 when mixing ARM/Thumb code under some conditions.
I wouldn't mind a confirmation that it's a real bug before opening an entry in bugzilla. This happens when the target function is: - ARM (32bits) code - not accessible with a short call (B or BL instruction) - called from Thumb at some place - called from ARM at some other place (and here the bug happens) ld inserts a __func_from_thumb veneer to be called by Thumb code, but this veneer is also called from ARM code, while ARM code should use a different veneer. (or even point directly to the ARM code of the veneer, after "bx pc" and "nop") I've attached a small commented test case: Just put the 4 files somewhere, edit Makefile to match your ARM compiler and run make test to build, link, and print commented objdump disassembly (look for "BUG" in the output). The linker script is necessary to put the function out of reach from short calls, I met the bug when building rockbox on targets with different RAMs which can't access each other with a short call (and there's no MMU on these devices to remap the memory regions close to each other). I had a look at bfd/elf32-arm.c but it's just too long for me to handle :) thanks -- Rafaël Carré
f.i
Description: Binary data
Makefile
Description: Binary data
start.i
Description: Binary data
test.lds
Description: Binary data
signature.asc
Description: PGP signature
_______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils