[PATCH] D105045: [lld-macho] Deduplicate CFStrings

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 11:35:04 PDT 2021


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a subscriber: mgrang.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

`__cfstring` is a special literal section, so instead of breaking it up
at symbol boundaries, we break it up at fixed-width boundaries (since
each literal is the same size). Symbols can only occur at one of those
boundaries, so this is strictly more powerful than
`.subsections_via_symbols`.

With that in place, we then run the section through ICF.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105045

Files:
  lld/MachO/ICF.cpp
  lld/MachO/InputFiles.cpp
  lld/MachO/InputSection.cpp
  lld/MachO/InputSection.h
  lld/test/MachO/Inputs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd
  lld/test/MachO/cfstring-dedup.s
  lld/test/MachO/invalid/cfstring.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105045.354959.patch
Type: text/x-patch
Size: 11060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210628/80007151/attachment.bin>


More information about the llvm-commits mailing list