This is not technically required, but glibc unwind-dw2-fde.c classify_object_over_fdes expects there is a CIE record length 0 as a terminator.
I would like tounderstand why this is needed.
You wrote: "This is not technically required, but glibc unwind-dw2-fde.c classify_object_over_fdes expects there is a CIE record length 0 as a terminator.".
Can you please point me on a line of code in glibc that needs this change in the linker? What is the current behavior of LLD linked binaries?
I think would be nice for that comment to contain some additional information, like:
for (; ! last_fde (ob, this_fde); this_fde = next_fde (this_fde))
last_fde is defined at https://code.woboq.org/userspace/glibc/sysdeps/generic/unwind-dw2-fde.h.html#162 . It does not check whether it reaches the end of .eh_frame (DWARF2_OBJECT_END_PTR_EXTENSION seems not defined). If there is no length=0 terminator, the pointer will run beyond the end of .eh_frame and run into successive sections (out-of-bound read), segfault or stop somewhere. This issue is usually latent/benign and I can only catch this in some internal statically-linked configuration. I don't have time to read the whole source code of how glibc/libgcc_s libunwind to understand why this routine is sometimes called but sometimes not.