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

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 05:58:18 PDT 2023


treapster added a comment.

In D146546#4212848 <https://reviews.llvm.org/D146546#4212848>, @yota9 wrote:

> From my standpoint this patch seems to be more solid and universal. We don't have to change structure, don't have to create pseudo relocation types on BOLT level and can compose relocations with more then 2 symbols easily if needed (although I'm, not sure if there are such cases). Indeed I was interested in this patch since the first thought was that might be re-used in golang support in couple of places and it seems to be a solution that might help with it. But the only major downside of this solution - we don't have special label relocations for aarch64/x86. But it seems to be reasonable addon and probably worth to speak with community about adding such types to other platforms too.

IMO if we can create some expressions in opaque way regardless of architecture, it's simpler than stacking up proper arch-specific relocations only to convert them to the same expression later. While this patch is more solid for incoming RISC-V relocs, having an internal opaque type is also useful, not necessarily implemented in the way it's done in my patch. It's definitely easier to implement internal hack than to force other platforms to introduce new relocation types. And since now we don't have needed types for AArch64/X86, i guess we have to invent our own anyway.


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