Skip to content

Commit

Permalink
mark .init and .trap sections as executable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
danc86 committed Aug 15, 2018
1 parent a6c53d6 commit 3538946
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riscv-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3538946

Please sign in to comment.