diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index 03aa4e20..00000000 --- a/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[target.target] -rustflags = ["-C", "link-arg=-s"] diff --git a/.travis.yml b/.travis.yml index 5c0c1f81..30d5aeb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ install: script: - cargo xbuild --release --target target.json - - cargo xclippy + - cargo xclippy --target target.json - cargo clippy --all-targets --all-features - cargo fmt --all -- --check - cargo test diff --git a/Cargo.toml b/Cargo.toml index bbaecd5c..82b3ba67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,14 +4,14 @@ version = "0.1.0" authors = ["Rob Bradford "] edition = "2018" -# the profile used for `cargo build` +# Despite "panic-strategy": "abort" being set in target.json, panic = "abort" is +# needed here to make "cargo check" and "cargo clippy" run without errors. [profile.dev] -panic = "abort" # disable stack unwinding on panic +panic = "abort" lto = true -# the profile used for `cargo build --release` [profile.release] -panic = "abort" # disable stack unwinding on panic +panic = "abort" lto = true [dependencies] diff --git a/layout.ld b/layout.ld index c3095013..a7861987 100644 --- a/layout.ld +++ b/layout.ld @@ -15,10 +15,9 @@ SECTIONS /* Mapping in the program headers makes it easier to mmap the whole file. */ . += SIZEOF_HEADERS ; - .rodata : { *(.rodata .rodata.*) } :rodata - .data : { *(.data .data.*) } :data - .bss : { *(.bss .bss.*) } :data - .text : { *(.text .text.*) } :text + .rodata : { *(.rodata .rodata.*) } :rodata + .data : { *(.data .data.*) *(.bss .bss.*) } :data + .text : { *(.text .text.*) } :text _end_of_file = . ; diff --git a/target.json b/target.json index 1d68d681..4814517d 100644 --- a/target.json +++ b/target.json @@ -12,8 +12,12 @@ "panic-strategy": "abort", "disable-redzone": true, "features": "-mmx,-sse,+soft-float", + "dynamic-linking-available": false, + "code-model": "small", + "relocation-model": "static", "pre-link-args": { "ld.lld": [ + "-s", "--script=layout.ld" ] }