[lld] [lld] Add infrastructure for handling RISCV vendor-specific relocations. (PR #159987)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 02:08:02 PDT 2025


================
@@ -0,0 +1,18 @@
+# RUN: llvm-mc -triple riscv32 %s -filetype=obj -o %t.o
+# RUN: not ld.lld -pie %t.o -o /dev/null 2>&1 | FileCheck %s
+
+  .option exact
+
+  .global TARGET
+TARGET:
+  nop
+
+.global INVALID_VENDOR
+.reloc 1f, R_RISCV_VENDOR, INVALID_VENDOR+0
+.reloc 1f, R_RISCV_VENDOR, INVALID_VENDOR+0
+.reloc 1f, R_RISCV_CUSTOM255, TARGET
+1:
+  nop
+
+# CHECK: error: {{.*}} malformed consecutive R_RISCV_VENDOR relocations
----------------
resistor wrote:

Done

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


More information about the llvm-commits mailing list