[PATCH] D117612: [BOLT] Update dynamic relocations from section relocations

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 24 09:07:30 PST 2022


yota9 added inline comments.


================
Comment at: bolt/include/bolt/Core/Relocation.h:56
+  /// the relocation is read from DT_JMPREL, otherwise it came from DT_RELA.
+  bool IsJmpRel = false;
+
----------------
yota9 wrote:
> maksfb wrote:
> > Instead of introducing this flag, could we change the rewriter to classify relocation types based on the input? 
> Sorry I'm not quite understand. Do you mean to classify it based on the relocation type? I did it in the first iteration of the patch, but as I said above we have a problem here: for example LD places R_AARCH64_TLSDESC in .rela.plt and lld places it in .rela.dyn, so there is not stable way to determine where did the relocation came from. Or you mean something else?
Or you mean to create the map of REL_TYPE->section while reading the relocations? Well it might work (of course if for some reason we won't met the same rel type in both sections). Plus we will need to handle this structure explicitly in case the new relocations are created during bolt work..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117612



More information about the llvm-commits mailing list