[PATCH] D132489: [MachO] Fix dead-stripping __eh_frame

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 02:24:58 PDT 2022


int3 added a comment.

@thevinster I think removing `S_ATTR_LIVE_SUPPORT` is probably the right fix here; it seems kind of unintuitive to rely on ICF to perform what is effectively dead stripping, and FDEs should indeed be kept alive only by the function symbol that they belong to. I don't think we need to worry about valid FDEs getting stripped. But yeah I would love to better understand how the CIE is getting stripped; I would expect it not to be, given that there should be a relocation from the FDE to the CIE that prevents that...



================
Comment at: lld/test/MachO/eh-frame-dead-strip.s:9-10
+## Verify that unneeded FDEs (and their CIEs) are dead-stripped even if they
+## point to a live symbol. This requires arm64 because x86_64 doesn't emit
+## a relocation for the function symbol in an FDE.
+
----------------
I was going to ask, doesn't our `registerEhFrames()` method create those relocations anyway? But then I realized that it would create a relocation pointing to the canonical symbol, instead of the coalesced-away weak symbol. But in that case... aren't the coalesced-away weak symbols not marked as live?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132489/new/

https://reviews.llvm.org/D132489



More information about the llvm-commits mailing list