[lld] [lld][macho] Support order cstrings with -order_file_cstring (PR #140307)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 09:48:13 PDT 2025


SharonXSharon wrote:

> can we extend `--symbol_ordering_file` format to include cstrings? E.g. instead of the symbol name on each line we would have something like `<cstr>:hash`.

I am not super familiar with ELF, I assume `--symbol_ordering_file` is the same with `-order_file` in MachO right? 
implementation wise it seems okay to extend this flag.

> the inability to specify a relative ordering of strings with respect to other static data objects.

In MachO, cstrings are put in a their own section which is separate from where the other static data symbols are put, so we can only order cstrings within their own section but not the relative order with other static data symbols. In ELF, are they both put in the same section so their relative orders also matter? 


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


More information about the llvm-commits mailing list