[PATCH] D145687: [BOLT] Add minimal RISC-V 64-bit support

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 13:55:09 PDT 2023


rafauler added inline comments.


================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:2669-2675
+    } else if (ReferencedSymbol) {
+      // This might be a relocation for an ABS symbols like __global_pointer$ on
+      // RISC-V
+      ContainingBF->addRelocation(Rel.getOffset(), ReferencedSymbol,
+                                  Rel.getType(), 0,
+                                  cantFail(Symbol.getValue()));
+      return;
----------------
The new solution is triggering a lot more than the previous one, now we're definitely getting undefined symbols. In one X86 input we're getting these entries now being used to generate relocs:

714106: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND symbol1
714107: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND symbol2

Unless we plan to define symbols in BOLT, which I can't think why we would do that, I think we should explicitly filter out undefined syms when adding relocations to functions.


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

https://reviews.llvm.org/D145687



More information about the llvm-commits mailing list