[llvm-branch-commits] [llvm] llvm-jitlink: Fix bug in target address computation. (PR #138794)

Lang Hames via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue May 6 20:17:00 PDT 2025


================
@@ -194,7 +194,8 @@ Error registerELFGraphInfo(Session &S, LinkGraph &G) {
     else
       FileInfo.SectionInfos[Sec.getName()] = {
           ArrayRef<char>(FirstSym->getBlock().getContent().data(), SecSize),
-          SecAddr.getValue(), FirstSym->getTargetFlags()};
+          (SecAddr - FirstSym->getOffset()).getValue(),
----------------
lhames wrote:

Instead of setting this here, it seems like it'd be tidier to define SecAddr like this on line 183:
```c++
auto SecAddr = FirstSym->getAddress() - FirstSym->getOffset();
```
Unless you've already tried that and hit other issues I'm happy to go ahead and make that change.

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


More information about the llvm-branch-commits mailing list