Use --gc-sections to remove unused program sections

This commit is contained in:
Philipp Oppermann
2017-04-11 18:52:31 +02:00
parent 5d8758df59
commit ff623a90e3
2 changed files with 2 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ $(iso): $(kernel) $(grub_cfg)
@rm -r build/isofiles @rm -r build/isofiles
$(kernel): kernel $(rust_os) $(assembly_object_files) $(linker_script) $(kernel): kernel $(rust_os) $(assembly_object_files) $(linker_script)
@ld -n -T $(linker_script) -o $(kernel) \ @ld -n --gc-sections -T $(linker_script) -o $(kernel) \
$(assembly_object_files) $(rust_os) $(assembly_object_files) $(rust_os)
kernel: kernel:

View File

@@ -6,7 +6,7 @@ SECTIONS {
.boot : .boot :
{ {
/* ensure that the multiboot header is at the beginning */ /* ensure that the multiboot header is at the beginning */
*(.multiboot_header) KEEP(*(.multiboot_header))
} }
.text : .text :