From eead1a57e0778f539131dd99be086dc44c4507df Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 20 May 2021 13:42:57 +0200 Subject: [PATCH 1/4] Fix nightly regerssion by manually passing `--gc-sections` Rust used to pass `--gc-section` automatically. In https://github.com/rust-lang/rust/pull/85274, this behavior was changed to only pass that flag for targets that use a GNU linker. So we have to add it manually, otherwise the bootloader grows too large to be loaded by our assembly stage. --- x86_64-bootloader.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x86_64-bootloader.json b/x86_64-bootloader.json index ad13109d..24be1991 100644 --- a/x86_64-bootloader.json +++ b/x86_64-bootloader.json @@ -5,8 +5,9 @@ "linker": "rust-lld", "pre-link-args": { "ld.lld": [ - "--script=linker.ld" - ] + "--script=linker.ld", + "--gc-sections" + ] }, "target-endian": "little", "target-pointer-width": "64", From 2afc7d778d327839231c6966e4bbb71e9dc7f33f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 20 May 2021 13:47:54 +0200 Subject: [PATCH 2/4] Update changelog for #168 --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index c237631f..898000d2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,7 @@ # Unreleased +- Fix nightly regression by manually passing --gc-sections ([#168](https://github.com/rust-osdev/bootloader/pull/168)) + # 0.9.17 – 2021-04-30 - Reduce the number of used unstable features of x86_64 crate (backport [#155](https://github.com/rust-osdev/bootloader/pull/140)) From 88bc669f45a5f7eb77af253290cc298a46ec2585 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 20 May 2021 13:59:08 +0200 Subject: [PATCH 3/4] Replace tabs with spaces Co-authored-by: bjorn3 --- x86_64-bootloader.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x86_64-bootloader.json b/x86_64-bootloader.json index 24be1991..b003982b 100644 --- a/x86_64-bootloader.json +++ b/x86_64-bootloader.json @@ -5,9 +5,9 @@ "linker": "rust-lld", "pre-link-args": { "ld.lld": [ - "--script=linker.ld", + "--script=linker.ld", "--gc-sections" - ] + ] }, "target-endian": "little", "target-pointer-width": "64", From 3ae79b8972d5fae62b42549ad84aa52c9a8e4ea6 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 20 May 2021 13:59:40 +0200 Subject: [PATCH 4/4] One more tab->spaces replacement --- x86_64-bootloader.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86_64-bootloader.json b/x86_64-bootloader.json index b003982b..ab1c5256 100644 --- a/x86_64-bootloader.json +++ b/x86_64-bootloader.json @@ -18,5 +18,5 @@ "disable-redzone": true, "panic": "abort", "executables": true, - "relocation_model": "static" + "relocation_model": "static" }