Skip to content

Commit 95b2837

Browse files
author
Anatol Ulrich
committed
fix #74
1 parent 4bb29e7 commit 95b2837

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cortex-m-rt/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,13 +910,15 @@ pub fn heap_start() -> *mut u32 {
910910

911911
// Entry point is Reset.
912912
#[doc(hidden)]
913-
#[link_section = ".vector_table.reset_vector"]
913+
#[cfg_attr(target_os = "macos", link_section = ".vector_table,reset_vector")]
914+
#[cfg_attr(not(target_os = "macos"), link_section = ".vector_table.reset_vector")]
914915
#[no_mangle]
915916
pub static __RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
916917

917918
#[allow(unused_variables)]
918919
#[doc(hidden)]
919-
#[link_section = ".HardFault.default"]
920+
#[cfg_attr(target_os = "macos", link_section = ".HardFault,default")]
921+
#[cfg_attr(not(target_os = "macos"), link_section = ".HardFault.default")]
920922
#[no_mangle]
921923
pub unsafe extern "C" fn HardFault_(ef: &ExceptionFrame) -> ! {
922924
loop {
@@ -1008,7 +1010,8 @@ pub union Vector {
10081010
}
10091011

10101012
#[doc(hidden)]
1011-
#[link_section = ".vector_table.exceptions"]
1013+
#[cfg_attr(target_os = "macos", link_section = ".vector_table,exceptions")]
1014+
#[cfg_attr(not(target_os = "macos"), link_section = ".vector_table.exceptions")]
10121015
#[no_mangle]
10131016
pub static __EXCEPTIONS: [Vector; 14] = [
10141017
// Exception 2: Non Maskable Interrupt.
@@ -1070,7 +1073,8 @@ pub static __EXCEPTIONS: [Vector; 14] = [
10701073
// to the default handler
10711074
#[cfg(all(any(not(feature = "device"), test), not(armv6m)))]
10721075
#[doc(hidden)]
1073-
#[link_section = ".vector_table.interrupts"]
1076+
#[cfg_attr(target_os = "macos", link_section = ".vector_table,interrupts")]
1077+
#[cfg_attr(not(target_os = "macos"), link_section = ".vector_table.interrupts")]
10741078
#[no_mangle]
10751079
pub static __INTERRUPTS: [unsafe extern "C" fn(); 240] = [{
10761080
extern "C" {

0 commit comments

Comments
 (0)