[lld] [lld-macho] Implement symbol string deduplication (PR #123874)
Vincent Lee via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 23:52:31 PST 2025
thevinster wrote:
> > Any reason why this needs a dedicated flag and isn't folded with the original `-deduplicate-strings` flag?
>
> @thevinster - I think of program string literals and metadata strings differently. For example you might want to disable string deduplication if using string pointers as unique keys. Since symbol strings are program metadata, they have different reasons for enabling / disabling deduplication. So I was thinking we would want different flags to control enabling/disabling the deduplication.
Okay, if there's a reason to disable `-deduplicate-strings` and enable symbol string deduplication, then I won't object. But while `-deduplicate-strings` is an lld specific flag, ld64 (and I believe ld-prime as well though I haven't checked) automatically enable this functionality by default. The Mach-O port also enables [`-deduplicate-strings`](https://github.com/llvm/llvm-project/blob/main/lld/MachO/Driver.cpp#L1807-L1808) by default, and it seems like you want to do the same as well for symbol string deduplication. Hence, my question of putting it under the same flag.
https://github.com/llvm/llvm-project/pull/123874
More information about the llvm-commits
mailing list