File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 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/).
1111
1212- New ` device ` feature to include ` device.x ` in ` link.x ` . This feature is based
1313 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.
1420
1521### Changed
1622
Original file line number Diff line number Diff line change @@ -38,3 +38,4 @@ u-boot = ["riscv-rt-macros/u-boot", "single-hart"]
3838no-interrupts = []
3939no-exceptions = []
4040device = []
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<()> {
2929 include_content. push_str ( "/* Device-specific exception and interrupt handlers */\n " ) ;
3030 include_content. push_str ( "INCLUDE device.x\n " ) ;
3131 }
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+ }
3237
3338 content = content. replace ( "${INCLUDE_LINKER_FILES}" , & include_content) ;
3439
You can’t perform that action at this time.
0 commit comments