linker.ld: Work around portability issue

This commit is contained in:
mintsuki 2022-06-26 21:34:35 +02:00
parent 3a71b67038
commit 1929fda490
2 changed files with 7 additions and 4 deletions

View file

@ -42,7 +42,7 @@ override INTERNALLDFLAGS := \
-nostdlib \
-static \
-Wl,-z,max-page-size=0x1000 \
-Wl,-T,linker.ld
-Wl,-T,linker-$(ARCH).ld
# Set archtecture specific variables (and check that the architecture is supported).
ifeq ($(ARCH),x86_64)
@ -56,9 +56,8 @@ ifeq ($(ARCH),x86_64)
-mno-sse2 \
-mno-red-zone \
-mcmodel=kernel
override INTERNALLDFLAGS += \
-Wl,-m,elf_x86_64 \
-Wl,--oformat=elf64-x86-64
override INTERNALLDFLAGS += \
-Wl,-m,elf_x86_64
else
$(error Architecture $(ARCH) not supported)
endif

View file

@ -1,3 +1,7 @@
/* Tell the linker that we want an x86_64 ELF64 output file */
OUTPUT_FORMAT(elf64-x86-64)
OUTPUT_ARCH(i386:x86-64)
/* We want the symbol _start to be our entry point */
ENTRY(_start)