It's still uncertain but whether we want to have deduplicate-literals be the
default flag for LLD out of the box or not. If deduplicate-literals is the default
behavior, then we will need a way override it and not deduplicate. Luckily, we
have no_deduplicate to fill this gap. For now, I've set the default to be false
which aligns with the existing behavior. That can only always be changed after
discussions on D117250.
Details
- Reviewers
int3 - Group Reviewers
Restricted Project - Commits
- rGe5347f2556cb: [lld-macho] Allow deduplicate-literals to be overridden
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It's worth noting that -no_deduplicate in ld64 actually turns off ICF, not string merging. I don't know if ld64 even has a way to turn off string merging, since IIRC it's implemented in the symbol table itself.
lld/MachO/Driver.cpp | ||
---|---|---|
1285 | I'm confused ... was the second argument meant to be OPT_no_deduplicate? The test seems to be passing though... |
lld/MachO/Driver.cpp | ||
---|---|---|
1285 | -no_deduplicate aliases to setting OPT_icf_eq to false :) |
It's worth noting that -no_deduplicate in ld64 actually turns off ICF, not string merging. I don't know if ld64 even has a way to turn off string merging, since IIRC it's implemented in the symbol table itself.
Yup. LLD's -no_deduplicate also turns off ICF but it _also_ turns off string merging. It's probably worth documenting this as well.
I'm confused ... was the second argument meant to be OPT_no_deduplicate? The test seems to be passing though...