Skip to content

Commit

Permalink
riscv64: Do not use global pointer register
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Jul 13, 2023
1 parent 5cbc71a commit f16b428
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions common/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ endif
ifeq ($(TARGET),uefi-riscv64)
override LDFLAGS_FOR_TARGET += \
-m elf64lriscv \
--no-relax \
-static \
-pie \
--no-dynamic-linker \
Expand Down
4 changes: 0 additions & 4 deletions common/efi_thunk.asm_uefi_riscv64
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions common/linker_uefi_riscv64.ld.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OUTPUT_FORMAT(elf64-littleriscv)
OUTPUT_ARCH(riscv)
OUTPUT_ARCH(riscv:rv64)
ENTRY(_start)

PHDRS
Expand Down Expand Up @@ -60,9 +60,6 @@ SECTIONS

data_begin = .;
*(.data .data.*)
__global_pointer$ = . + 0x800;
*(.sdata .sdata.*)
*(.sbss .sbss.*)
*(.bss .bss.*)
*(COMMON)
data_end = .;
Expand Down

0 comments on commit f16b428

Please sign in to comment.