About 7 month ago we had a patch D15564 ("[ELF] - Optimize .eh_frame section: remove
CIE if all FDEs referencing it were removed."). It was committed but then reverted.
I didn't commit a piece of code and testcase did not catxh this, I wanted to improve it before
recommit.
But nowadays this patch seems to be few lines trivial. And I think it is ok now.
Details
Diff Detail
Event Timeline
It may be a good change, but honestly do we care about this case? How realistic is it?
Since that was really long time ago, I do not remember my motivation to prepare this patch.
That is something what gold do for sure. Let me perform some investigation about
this then to find how much that is usefull.
Looks that is not useful. I tried to selflink clang and lld with and without this change and size of .eh_frame did not change for me.
I wouldn't jump to conclusions too quickly. I don't think clang uses exceptions (at least I haven't seen any use of that).
Also, even if I'm wrong about clang, I'd rather test multiple programs (finding some which (ab)use exceptions) before deciding if this feature is "useful" or not.
I bet it will be, FWIW.
This is not important, I think. CIE records are small, and we have only one CIE for each input file, so removing them wound't save that much space.