HA: [lld] r257753 - [ELF] - implemented --eh-frame-hdr command line option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 05:44:04 PST 2016


>>>
>>>crtend.o file has .eh_frame section four byte length filled by zero.
>>>If i do not make a mistake after this commit LLD crashes on this
>>>section with "corrupted or unsupported CIE information" error.
>>>...
>>>
>>>--
>>>Simon Atanasyan
>>
>> Hello, Simon,
>> thanks for info !
>>
>> The case you're pointing really looks like a special case which we should support.
>> I`ll take a look closer on it tomorrow if you dont mind.
>>
>> As far as I know both bfd and gold just drop the creation of eh_frame_hdr if are not able to parse something in eh_frame.
>> We did it in another way. We assume that inputs should be correct and just exit with error.
>> I wonder if this is the only such exception we can meet in real life ? Currently lld will error exit on all corrupted/unsupported eh_frames if --eh-frame-hdr is specified.
>
>I think this case is a standard. FDE has multiple 'required' fields
>but the first field "Length" has the following description:
>[[
>A 4 byte unsigned value indicating the length in bytes of the CIE
>structure, not including the Length field itself... If Length contains
>the value 0, then this CIE shall be considered a terminator and
>processing shall end.
>]]
>https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html
>
>Here is one more reference link. Look at the line 656.
>https://github.com/gcc-mirror/gcc/blob/master/libgcc/crtstuff.c#L656
>
>--
>Simon Atanasyan

You`re right.  r257889 fixes it, it also fixes "Bug 25923 - lld/ELF2 linked application crashes if exceptions were used. ".
Many thanks for pointing on all of that !

George.



More information about the llvm-commits mailing list