Skip to content

Commit 3538946

Browse files
committed
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
1 parent a6c53d6 commit 3538946

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

riscv-rt/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ extern "C" {
205205
/// pointer. Then it calls _start_rust.
206206
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
207207
global_asm!(r#"
208-
.section .init
208+
.section .init, "ax"
209209
.globl _start
210210
_start:
211211
.cfi_startproc
@@ -295,7 +295,7 @@ macro_rules! entry {
295295
/// restores caller saved registers and then returns.
296296
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
297297
global_asm!(r#"
298-
.section .trap
298+
.section .trap, "ax"
299299
.align 4
300300
.global _start_trap
301301

0 commit comments

Comments
 (0)