Merge "Add riscv64 support to the linker relocation benchmark."
diff --git a/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h b/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h
index 2ff3d81..885e47f 100644
--- a/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h
+++ b/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h
@@ -42,6 +42,15 @@
#define DATA_WORD(val) .quad val
#define MAIN .globl main; main: mov w0, wzr; ret
+#elif defined(__riscv)
+
+// No `lga` in clang unless https://reviews.llvm.org/D107278 lands.
+// `la` is equivalent when using PIC (which we do) though.
+#define GOT_RELOC(sym) la a0, sym
+#define CALL(sym) call sym@plt
+#define DATA_WORD(val) .quad val
+#define MAIN .globl main; main: li a0, 0; ret
+
#elif defined(__i386__)
#define GOT_RELOC(sym) .long sym@got