riscv64: Do not use global pointer register
diff --git a/common/GNUmakefile b/common/GNUmakefile
index 54648f8c..8857ae9c 100644
--- a/common/GNUmakefile
+++ b/common/GNUmakefile
@@ -195,6 +195,7 @@ endif
ifeq ($(TARGET),uefi-riscv64)
override LDFLAGS_FOR_TARGET += \
-m elf64lriscv \
+ --no-relax \
-static \
-pie \
--no-dynamic-linker \
diff --git a/common/efi_thunk.asm_uefi_riscv64 b/common/efi_thunk.asm_uefi_riscv64
index 9cfd4eee..f99508b3 100644
--- a/common/efi_thunk.asm_uefi_riscv64
+++ b/common/efi_thunk.asm_uefi_riscv64
@@ -3,10 +3,6 @@
.global efi_main
.extern uefi_entry
efi_main:
-.option push
-.option norelax
- lla gp, __global_pointer$
-.option pop
mv fp, zero
mv ra, zero
j uefi_entry
diff --git a/common/linker_uefi_riscv64.ld.in b/common/linker_uefi_riscv64.ld.in
index cbb2eb0b..746b02ba 100644
--- a/common/linker_uefi_riscv64.ld.in
+++ b/common/linker_uefi_riscv64.ld.in
@@ -1,5 +1,5 @@
OUTPUT_FORMAT(elf64-littleriscv)
-OUTPUT_ARCH(riscv)
+OUTPUT_ARCH(riscv:rv64)
ENTRY(_start)
PHDRS
@@ -60,9 +60,6 @@ SECTIONS
data_begin = .;
*(.data .data.*)
- __global_pointer$ = . + 0x800;
- *(.sdata .sdata.*)
- *(.sbss .sbss.*)
*(.bss .bss.*)
*(COMMON)
data_end = .;
