Section layout with ld script for flash based ARM system : what's wrong?
Richard Earnshaw
rearnsha@arm.com
Wed Jun 11 09:23:00 GMT 2003
> Thanks Bill for the information.
>
> I added the -mlong-calls switch and lots of errors are gone but, as the docs
> say, it doesn't handle the calls via function pointers (I keep having a
> relocation error for call_via_r2 and call_via_r3 functions).
> I will investigate that more carefully.
Strictly speaking, there shouldn't be any need for -mlong-calls, in terms
of efficiency its a rather large sledgehammer for the nut that needs
cracking. Instead the linker should be adding trampoline veneers to fix
up the calls that don't reach. That's quite hard to do really well,
particularly if you try to build a HUGE section with Thumb code (spans
more than the 2^22 bit range of the thumb BL instruction), but for the
common case is not that dissimilar to the interworking fixups or
shared-library creation that is already done. We really ought to fix ld.
R.
More information about the Binutils
mailing list