[lld] [lld][MachO] Read cstring order for non deduped sections (PR #161879)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 10:57:29 PDT 2025


ellishg wrote:

> > Create cStringPriorities, separate from priorities, to hold only priorities for cstring pieces
> 
> On #140307, i was originally using a separate cStringPriorities and , but was suggested to use a unified structure, so are we proposing keeping the one `-order_file` input but processing regular symbol and cstring separately depending on the entry?

This PR does not change the behavior of `-order_file`, it can still accept symbol and cstring orders. The problem is `priorities` contains both symbol and cstring entries, and we need to convert cstring hashes back to a string in order to lookup the entry in the map. I brought this up in https://github.com/llvm/llvm-project/pull/140307#discussion_r2112153732, but I guess it got lost.

Instead, we separate the map into `priorities` for symbols and `cStringPriorities` for cstrings, which is keyed by hash rather than a string.

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


More information about the llvm-commits mailing list