[lld] [llvm] [feature][riscv] handle target address calculation in llvm-objdump disassembly for riscv (PR #109914)
Arjun Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 9 21:47:48 PDT 2025
================
@@ -2392,14 +2393,18 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
[=](const std::pair<uint64_t, SectionRef> &O) {
return O.first <= Target;
});
- uint64_t TargetSecAddr = 0;
+ uint64_t TargetSecAddr = It == SectionAddresses.end() ? 0 : It->first;
----------------
arjunUpatel wrote:
Yes, and the following loop. Previously, the loop would only add labels in the set of sections that were closest to `Target`. _Set_ of section here because multiple sections can have the same address, so all of their symbols would be added to the set of candidate symbols. The problem here is that that sometimes this set of sections would not have any symbols, which would cause global symbols to be used for address resolution. The following changes make it such that we loop down from sections closest to the `Target` and populate the set of candidate symbols with symbols from the first set of sections that do contain symbols. This change bumps the address resolution capability to better match that of binutils
https://github.com/llvm/llvm-project/pull/109914
More information about the llvm-commits
mailing list