diff --git a/kernel/GNUmakefile b/kernel/GNUmakefile index 0490512..1ac0c2f 100644 --- a/kernel/GNUmakefile +++ b/kernel/GNUmakefile @@ -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 diff --git a/kernel/linker.ld b/kernel/linker-x86_64.ld similarity index 91% rename from kernel/linker.ld rename to kernel/linker-x86_64.ld index 36fc281..3b0de45 100644 --- a/kernel/linker.ld +++ b/kernel/linker-x86_64.ld @@ -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)