[PATCH] D24728: [ARM][LLD] Add support for .ARM.exidx sections

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 16:41:12 PDT 2016


My understanding is that ARM support in gold is reasonable, but it is
not as complete or correct as bfd and isn't actively maintained at the
moment. There was an attempt in Linaro to use it in the ARM buildbots
but it had sufficiently more problems than bfd to go back to bfd.

I've made a start on splitting up the patch. I won't get finished
today, but I hope to have something tomorrow. My current plan is:
Patch 1: No special code for relocatable objects, but full support and
tests for garbage collection
Patch 2: A generic relocatable object change + tests to maintain the
full section names in getOutputSectionName(), so .text.function will
remain .text.function instead of being truncated to .text
Patch 3: Add support and tests for relocatable objects and ARM
exceptions, at a minimum this will be to add the sh_link in the
OutputSection. I'm thinking that sorting the .ARM.exidx sections will
fix the problem in the above linker script, but it will be possible to
write linker scripts for ld -r that won't work [*].

To complete exceptions support I've got a couple more simple patches
to add some relocations like R_ARM_TARGET2, but these are
straightforward.

I'm happy to make alternative plans if there are other preferences.

[*] I think that the only way to allow someone to write a linker
script for ld -r and have exceptions support is to make some kind of
custom routine that takes out the .ARM.exidx sections and makes the
correct number of .ARM.exidx sections with the correct sh_link. I'm
happy to write this but I think it can be deferred to when it is
needed.

On 28 September 2016 at 15:39, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> On 28 September 2016 at 13:31, Rui Ueyama <ruiu at google.com> wrote:
>> On Tue, Sep 27, 2016 at 3:55 PM, Rafael EspĂ­ndola
>> <rafael.espindola at gmail.com> wrote:
>>>
>>> Another interesting thing I noticed: it looks like gold doesn't
>>> implement the order restriction at all. The reason things work is
>>> because they are concatenated in the same order as the sections they
>>> point to.
>>>
>>> For example, given the script
>>>
>>> SECTIONS
>>> {
>>>   .text : { test1.o(.text) test3.o(.text) test2.o(.text) }
>>> }
>>>
>>> and a command line of "test1.o test2.o test3.o", the output .ARM.exidx
>>> will be in the wrong order.
>>
>>
>> That's an interesting finding, but I'm wondering how much gold's ARM support
>> mature. IIUC, Mips support in gold is immature compared to ld.bfd, so if
>> that's the case for ARM, this might not just be implemented yet.
>
> Yes, I pointed it out not to say that we should not implement it, but
> as an indication that it provides a path for splitting the patch up.
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list