From fcf69dcc5317cdae25a2b07dd34c12007353d784 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sat, 22 Aug 2015 13:14:47 +0200 Subject: [PATCH] Remove unused sections to avoid float issues Avoids a linker error for `fmod` and `fmodf`. These functions are refenced in libcore. The KEEP ensures that the Multiboot section isn't removed. --- Makefile | 2 +- src/arch/x86_64/linker.ld | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0bac1460..1650f297 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ $(iso): $(kernel) @rm -r build/isofiles $(kernel): cargo $(rust_os) $(assembly_object_files) $(linker_script) - @ld -n -T $(linker_script) -o $(kernel) $(assembly_object_files) $(rust_os) + @ld -n --gc-sections -T $(linker_script) -o $(kernel) $(assembly_object_files) $(rust_os) cargo: @cargo build diff --git a/src/arch/x86_64/linker.ld b/src/arch/x86_64/linker.ld index 4aea8987..8334f3d3 100644 --- a/src/arch/x86_64/linker.ld +++ b/src/arch/x86_64/linker.ld @@ -22,7 +22,7 @@ SECTIONS { .boot : { /* ensure that the multiboot header is at the beginning */ - *(.multiboot) + KEEP(*(.multiboot)) } .text :