File tree 3 files changed +12
-0
lines changed
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
11
11
12
12
- New ` device ` feature to include ` device.x ` in ` link.x ` . This feature is based
13
13
on the current implementation of ` cortex-m-rt ` .
14
+ - New ` memory ` feature to include ` memory.x ` in ` link.x ` . This feature is based
15
+ on the current implementation of ` cortex-m-rt ` . However, in contrast with
16
+ ` cortex-m-rt ` , including ` memory.x ` in the linker file is feature gated.
17
+ The benefits of leaving this optional are backwards compatibility and
18
+ allowing users to define less typical linker scripts that do not rely on a
19
+ ` device.x ` or ` memory.x ` file.
14
20
15
21
### Changed
16
22
Original file line number Diff line number Diff line change @@ -38,3 +38,4 @@ u-boot = ["riscv-rt-macros/u-boot", "single-hart"]
38
38
no-interrupts = []
39
39
no-exceptions = []
40
40
device = []
41
+ memory = []
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ fn add_linker_script(arch_width: u32) -> io::Result<()> {
29
29
include_content. push_str ( "/* Device-specific exception and interrupt handlers */\n " ) ;
30
30
include_content. push_str ( "INCLUDE device.x\n " ) ;
31
31
}
32
+ // If memory is enabled, include the memory.x file (usually, provided by BSPs)
33
+ if env:: var_os ( "CARGO_FEATURE_MEMORY" ) . is_some ( ) {
34
+ include_content. push_str ( "/* Device-specific memory layout */\n " ) ;
35
+ include_content. push_str ( "INCLUDE memory.x\n " ) ;
36
+ }
32
37
33
38
content = content. replace ( "${INCLUDE_LINKER_FILES}" , & include_content) ;
34
39
You can’t perform that action at this time.
0 commit comments