diff options
author | 2018-08-07 14:43:28 -0500 | |
---|---|---|
committer | 2018-08-07 15:22:39 -0500 | |
commit | f2c5e2e4058b0a57a1d874878bde67f612b2d9dd (patch) | |
tree | ba2164706a20c1fac83a9118753cd81302724402 /cortex-m-rt/build.rs | |
parent | 6e5e5ea4597ec6634f5d730b3218f8b71156da40 (diff) | |
download | cortex-m-f2c5e2e4058b0a57a1d874878bde67f612b2d9dd.tar.gz cortex-m-f2c5e2e4058b0a57a1d874878bde67f612b2d9dd.tar.zst cortex-m-f2c5e2e4058b0a57a1d874878bde67f612b2d9dd.zip |
refactor the linker script
to make it more compatible with LLD. This commit contains no functional changes.
fixes #70
Overview of changes:
- Alignment checks are enabled now that rust-lld (LLD 7.0) supports the modulo
operator.
- Removed some private symbols (e.g. __foo) in favor of ADDR and SIZEOF.
- Turned .got into a NOLOAD section now that rust-lld supports it.
- Replaced `ABSOLUTE(.)` with `.` as an old LLD overlap bug seems to be gone and
ABSOLUTE seems to cause problems, like #70, on bigger programs.
- Made the linker assertion messages more uniform.
- Extended test suite to check that linking works with both rust-lld and GNU
LD.
Diffstat (limited to 'cortex-m-rt/build.rs')
-rw-r--r-- | cortex-m-rt/build.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cortex-m-rt/build.rs b/cortex-m-rt/build.rs index 8edba9f..fc53d79 100644 --- a/cortex-m-rt/build.rs +++ b/cortex-m-rt/build.rs @@ -42,12 +42,12 @@ INCLUDE device.x"# writeln!( f, r#" -ASSERT(__einterrupts - __eexceptions <= 0x{:x}, " -There can't be more than {} interrupt handlers. This may be a bug in -your device crate, or you may have registered more than 240 interrupt +ASSERT(SIZEOF(.vector_table) <= 0x{:x}, " +There can't be more than {1} interrupt handlers. This may be a bug in +your device crate, or you may have registered more than {1} interrupt handlers."); "#, - max_int_handlers * 4, + max_int_handlers * 4 + 0x40, max_int_handlers ).unwrap(); |