.cfi_startproc/.cfi_endproc associated with an empty function
Jan Beulich
jbeulich@suse.com
Fri Mar 24 07:14:29 GMT 2023
On 24.03.2023 05:04, Fangrui Song wrote:
> Hello, https://github.com/llvm/llvm-project/issues/61434 reported an
> issue that Call Frame Information FDE associated with an empty PC
> range (address_range == 0) can cause trouble with .eh_frame linking.
> For your convenience, you may copy and paste the commands on
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109267 .
> I think the problem can be addressed with one of the following methods:
>
> * GCC and Clang can avoid generating `.cfi_startproc/.cfi_endproc` for
> empty functions (literally no instruction (no RET or NOP or TRAP),
> st_size is zero)
> * GNU assembler and LLVM integrated assembler can avoid generating FDE
> for `.cfi_startproc/.cfi_endproc` associated with empty functions.
> * Linkers can discard FDE associated with empty functions. I think GNU
> ld seems to do this, but I am unsure whether it's enforced. Even if I
> know that --icf=all and --gc-sections have some effects on .eh_frame
> linking, without using the two features discarding input sections
> magically appears to deviate from the ELF spirit.
> * libgcc_s/libunwind ignore FDE associated with empty functions.
>
> What are your thoughts?
I don't think assemblers should ignore directives. But compilers may
elect to avoid emitting them.
Jan
More information about the Binutils
mailing list