[PATCH v3] Support multiple .eh_frame sections
Jojo R
rjiejie@linux.alibaba.com
Fri Nov 4 01:50:30 GMT 2022
在 2022/11/4 03:34, Fangrui Song 写道:
> On Thu, Nov 3, 2022 at 3:26 AM Nick Clifton via Binutils
> <binutils@sourceware.org> wrote:
>> Hi Jojo,
>>
>>> This patch is based on MULTIPLE_FRAME_SECTIONS and EH_FRAME_LINKONCE,
>>> it allows backend to enable this feature and use '--gc-sections' simply.
>>>
>>> * gas/dw2gencfi.h (TARGET_MULTIPLE_EH_FRAME_SECTIONS): New.
>>> (MULTIPLE_FRAME_SECTIONS): Add TARGET_MULTIPLE_EH_FRAME_SECTIONS.
>>> * gas/dw2gencfi.c (EH_FRAME_LINKONCE): Add TARGET_MULTIPLE_EH_FRAME_SECTIONS.
>>> (is_now_linkonce_segment): Likewise.
>>> (get_cfi_seg): Create relocation info between .eh_frame.* and .text.* section.
>>>
>>> * bfd/elf-bfd.h (elf_backend_can_make_multiple_eh_frame): New.
>>> * bfd/elfxx-target.h (elf_backend_can_make_multiple_eh_frame): Likewise.
>>> * bfd/elflink.c (_bfd_elf_default_action_discarded): Add checking for
>>> elf_backend_can_make_multiple_eh_frame.
>>
>> Approved - please apply.
>>
>> Cheers
>> Nick
>>
> Hi Jojo, is there a test demonstrating the handling of multiple
> .eh_frame? Input .eh_frame or output .eh_frame?
>
> .eh_frame handling is known to be weird with --gc-sections but linkers
> have gained support:
> https://maskray.me/blog/2020-11-08-stack-unwinding#linker-perspective
We want to encode another eh_frame format like arm, and based on
seprated eh_frame sections :)
> Since monolithic .eh_frame has been around for so long, some tools may
> gain reliance on it and they will need to be fixed.
> Also, it'd be nice to verify that .eh_frame_hdr and PT_GNU_EH_FRAME
> creation is still correct.
Thanks for your mention, it looks good for baremetal.
.eh_frame_hdr or shared libs system like linux is not supported by now,
we will append another patch later if we finished that.
More information about the Binutils
mailing list