From 7b413a89f0cae7c32df6778f2b36978eb00a0eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 22 Jun 2024 15:01:44 +0200 Subject: [PATCH] std.os.linux.start_pie: Handle riscv32 in getDynamicSymbol(). --- lib/std/os/linux/start_pie.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/os/linux/start_pie.zig b/lib/std/os/linux/start_pie.zig index df909a623034..9b0a59e89a46 100644 --- a/lib/std/os/linux/start_pie.zig +++ b/lib/std/os/linux/start_pie.zig @@ -15,7 +15,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { .x86_64 => R_AMD64_RELATIVE, .arm => R_ARM_RELATIVE, .aarch64 => R_AARCH64_RELATIVE, - .riscv64 => R_RISCV_RELATIVE, + .riscv32, .riscv64 => R_RISCV_RELATIVE, else => @compileError("Missing R_RELATIVE definition for this target"), }; @@ -57,7 +57,7 @@ fn getDynamicSymbol() [*]elf.Dyn { \\ add %[ret], %[ret], #:lo12:_DYNAMIC : [ret] "=r" (-> [*]elf.Dyn), ), - .riscv64 => asm volatile ( + .riscv32, .riscv64 => asm volatile ( \\ .weak _DYNAMIC \\ .hidden _DYNAMIC \\ lla %[ret], _DYNAMIC