Parcourir la source

mark .init and .trap sections as executable

This is needed for lld, otherwise it will complain about section flag
mismatch:

    ld.lld: error: incompatible section flags for .text
    >>> target/riscv32imac-unknown-none/debug/deps/libriscv_rt-7850ee1a6233fbe9.rlib(riscv_rt-7850ee1a6233fbe9.4tmuw4s4crjeqbm5.rcgu.o):(.trap): 0x4
    >>> output section .text: 0x6
Dan Callaghan il y a 6 ans
Parent
commit
353894662c
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      riscv-rt/src/lib.rs

+ 2 - 2
riscv-rt/src/lib.rs

@@ -205,7 +205,7 @@ extern "C" {
 /// pointer. Then it calls _start_rust.
 #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
 global_asm!(r#"
-.section .init
+.section .init, "ax"
 .globl _start
 _start:
   .cfi_startproc
@@ -295,7 +295,7 @@ macro_rules! entry {
 /// restores caller saved registers and then returns.
 #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
 global_asm!(r#"
-  .section .trap
+  .section .trap, "ax"
   .align 4
   .global _start_trap