[PATCH] D146546: [BOLT][RFC] Implement composed relocations

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 02:12:03 PDT 2023


treapster added a comment.

> The implemented feature isn't used (afaict) by X86 or AArch64 so this should in principle be NFC

In fact we need to have it for other targets because for example some golang <https://reviews.llvm.org/D124347> structures contain offsets into .text which is ok if we know output .text address, but if we land https://reviews.llvm.org/D144560 it would be cumbersume to reserve .text address ahead of time, and i think other cases of symbol diffs or other expressions may emerge outside of golang. Last week i tried to merge golang with -rewrite and ended up creating bogus relocation type which can contain arbitrary symbol expression and has advantages of not using multiset and extra indirection at the cost of privatizing Relocation::Symbol. However, in case of RISCV we'll need to collect composed relocations in a single expression while reading them and only then add them to BinarySection. Here's the patch, should i open a competing RFC with it?:)F26864023: 0001-BOLT-Use-raw-MCExpr-to-express-symbol-differences.patch <https://reviews.llvm.org/F26864023>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146546/new/

https://reviews.llvm.org/D146546



More information about the llvm-commits mailing list