[llvm] [RuntimeDyld][ELF][AArch64] Fix resolveAArch64ShortBranch. (PR #92245)

Alastair Houghton via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 07:02:14 PDT 2024


al45tair wrote:

I don't see how that could happen. There are two calls to `resolveRelocation()` in `resolveAArch64Branch()`. Both of them set `Value` to `Section.getAddressWithOffset(Section.getStubOffset())`, and we can see that `Section.Address` is `0xf1a10000` while `Section.StubOffset` is `4`, so

```
  /// Return the address of this section with an offset.
  uint8_t *getAddressWithOffset(unsigned OffsetBytes) const {
    assert(OffsetBytes <= AllocationSize && "Offset out of bounds!");
    return Address + OffsetBytes;
  }
```

will return `0xf1a10004`, as expected, as a 32-bit `uint8_t` pointer.

Any chance you could set a breakpoint on `resolveAArch64Branch` and step until you get to the `resolveRelocation` call itself, then print `Section.getAddressWithOffset(Section.getStubOffset())` and see what you get?

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


More information about the llvm-commits mailing list