[llvm] [llvm-nm] Improve performance while faking symbols from function starts (PR #162755)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 16:15:32 PDT 2025


Daniel =?utf-8?q?Rodríguez?= <danielrodriguez at meta.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/162755 at github.com>


https://github.com/ellishg approved this pull request.

Just wanted to point out that this optimization only works if all elements in `FoundFns` is unique, otherwise we will need to update `SymbolAddresses` here:

https://github.com/llvm/llvm-project/blob/0aef9ebc14f5bc6d47d77e0905f0df0bfd846d1a/llvm/tools/llvm-nm/llvm-nm.cpp#L1664

After talking offline, I'm convinced this is the case, although it may be worth adding a comment on this.
> `LC_FUNCTION_STARTS` is delta encoded list of addresses from the start of `__TEXT`, which finishes when 0 is found. Because of that, all the addresses should be unique.

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


More information about the llvm-commits mailing list