[llvm] MC: Refine ALIGN relocation conditions (PR #150816)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 7 18:18:14 PDT 2025


================
@@ -32,6 +32,11 @@ static cl::opt<bool> ULEB128Reloc(
     "riscv-uleb128-reloc", cl::init(true), cl::Hidden,
     cl::desc("Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate"));
 
+static cl::opt<bool>
+    AlignRvc("riscv-align-rvc", cl::init(true), cl::Hidden,
+             cl::desc("When generating R_RISCV_ALIGN, insert $alignment-2 "
+                      "bytes of NOPs even in norvc code"));
----------------
MaskRay wrote:

Yes, we can get rid of them after all the tests are updated. This might also be useful to restore the old behavior for debugging before toolchain's R_RISCV_ALIGN becomes more stable. This should hopefully be removed in one year or two.

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


More information about the llvm-commits mailing list