[PATCH] D104671: [lld-macho] Extend ICF to literal sections

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 22:37:03 PDT 2021


int3 added inline comments.


================
Comment at: lld/MachO/Writer.cpp:948
+  if (in.cStringSection)
+    in.cStringSection->finalizeContents();
+  // TODO: WordLiteralSection & CFStringSection should be finalized here too
----------------
int3 wrote:
> thakis wrote:
> > I rebased the cstring alignment patch across this naively (a8a6e5b094aac642f436390294ec837400c521bb) and this came out pretty weird (because for non-deduped cstring sections this doesn't do any folding).
> > 
> > Maybe CStringSection should keep overriding finalize() and also add an empty virtual foldLiterals that DedupCStringSection overrides?
> I think it would be confusing / a potential source of bugs to have `CStringSection` and `DedupCStringSection` finalized at different points in the link. Perhaps a comment here would be sufficient?
comment added in D105044


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104671



More information about the llvm-commits mailing list