Skip to content

Commit b16e341

Browse files
committed
Remove reference to .bootloader-config section by renaming it to .note.bootloader-config
1 parent b394598 commit b16e341

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

api/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ macro_rules! entry_point {
113113
};
114114
($path:path, config = $config:expr) => {
115115
const _: () = {
116-
#[link_section = ".bootloader-config"]
116+
#[used]
117+
#[link_section = ".note.bootloader-config"]
117118
pub static __BOOTLOADER_CONFIG: [u8; $crate::BootloaderConfig::SERIALIZED_LEN] = {
118119
// validate the type
119120
let config: &$crate::BootloaderConfig = $config;
@@ -125,9 +126,6 @@ macro_rules! entry_point {
125126
// validate the signature of the program entry point
126127
let f: fn(&'static mut $crate::BootInfo) -> ! = $path;
127128

128-
// ensure that the config is used so that the linker keeps it
129-
$crate::__force_use(&__BOOTLOADER_CONFIG);
130-
131129
f(boot_info)
132130
}
133131
};

common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'a> Kernel<'a> {
103103
let kernel_elf = ElfFile::new(kernel_slice).unwrap();
104104
let config = {
105105
let section = kernel_elf
106-
.find_section_by_name(".bootloader-config")
106+
.find_section_by_name(".note.bootloader-config")
107107
.expect("bootloader config section not found; kernel must be compiled against bootloader_api");
108108
let raw = section.raw_data(&kernel_elf);
109109
BootloaderConfig::deserialize(raw)

0 commit comments

Comments
 (0)