File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff 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 } ;
Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments