[PATCH 3/4] elf: Avoid linker crash on corrupt .eh_frame section
Nick Clifton
nickc@redhat.com
Fri Oct 3 13:13:30 GMT 2025
Hi Guys,
>>>>>> Return false on corrupt .eh_frame section. Cap the .eh_frame section
>>>>>> alignment to the larger of the section size and the pointer size.
>>>>>
>>>>> Like for patch 2, I'm unconvinced of it being a good idea to build in
>>>>> heuristics like this. What if someone feels a need to align .eh_frame
>>>>> to, say, a page boundary?
>> So far, we don't have any request for large .eh_frame section alignment.
>> My patch simply changes the linker crash to a linker error. If people
>> do need large .eh_frame section alignments in the future, we can work
>> with them to resolve their issues.
>
> That's not how I look at things, sorry. If Alan or Nick want to approve this
> patch, I'm not going to stand in the way, but I won't (and I object to you
> putting it in without approval, ftaod).
I am with Jan here. If we are going to implement a cap on the .eh_frame
section size then we need to a) document it and b) inform the user if the
cap is ever exceeded, oh and c) not break if it happens.
Setting an arbitrary limit of max(pointer size, section size) makes sense
from a practical point of view, but we must be ready to revisit this decision
if it turns out that there are real world situations where a larger alignment
(eg page boundary) is desired.
So either the code must support any (power of two) alignment, or it must
be friendly to the user and let them know if a limit is reached.
Cheers
Nick
More information about the Binutils
mailing list