On 27/01/16 16:57, Jim Wilson wrote:
On Wed, Jan 27, 2016 at 8:37 AM, Christophe Lyon christophe.lyon@linaro.org wrote:
I confirm the trampolines are not inserted for ld -r.
We can't insert the trampolines with ld -r. We don't have all of the symbols required for this with a relocatable link. Also, for the symbols we do have, we don't know the final addresses, so we don't know which branches/calls will be out of range.
Maybe using -ffunction-sections would help?
Using -mlong-calls might be easier. You would only want this enabled for a allyesconfig build of course. This should solve the out-of-range calls to the spin lock functions. it probably doesn't help for the out-of-range branches to the .text.unlikely sections, but this is a gcc optimization that can be disabled with -fno-reorder-functions. This is again something you would only want for an allyesconfig build.
Jim
Long calls would probably solve the problem, but would likely be horribly expensive in performance.
The best solution would be to have an option to prevent ld -r from merging like-named sections (instead just aggregating multiple sections with similar names into one object file). This is possible in ELF.
R. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.