link.Elf: Define __global_pointer$ for riscv32 too.

See: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc
This commit is contained in:
Alex Rønne Petersen 2024-06-22 14:40:45 +02:00
parent 11badbfe8e
commit 6ec7757914
No known key found for this signature in database

View File

@ -3150,7 +3150,7 @@ fn addLinkerDefinedSymbols(self: *Elf) !void {
}
}
if (self.getTarget().cpu.arch == .riscv64 and self.isEffectivelyDynLib()) {
if (self.getTarget().cpu.arch.isRISCV() and self.isEffectivelyDynLib()) {
self.global_pointer_index = try linker_defined.addGlobal("__global_pointer$", self);
}