[lld] [LLD][MachO] Option to emit separate cstring sections (PR #158720)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 12:44:15 PDT 2025


ellishg wrote:

> > Maybe a little bit off-topic, but could we consider installing string tail merging for `__objc_methname`? I am wondering if this worth a dedicated RFC thread. Previously it was disabled unconditionally for linking performance (see https://reviews.llvm.org/D117273). Would it make sense to revisit the trade-offs now, perhaps behind a flag or with heuristics, given potential size wins on large ObjC codebases?
> 
> I wasn't aware of string tail merging. Thanks for sharing! I think it's definitely worth pursuing if it gives a size win. Do ObjC methods tend to have shares suffixes? I would assume they might share prefixes if two methods are the same but with different number of arguments.

I just check a large binary and it seems 3.7% of strings in the `__objc_methname` ends with another string. So this seems promising!

https://github.com/llvm/llvm-project/pull/158720


More information about the llvm-commits mailing list