Skip to content

Commit 359d28c

Browse files
committed
Add dummy PrgData section and move device description to DevDescr section
1 parent 5b03fb8 commit 359d28c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

link.x

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ SECTIONS {
3636
}
3737

3838
/*
39-
* The device description is usually in DevDscr section, but adding it to
40-
* PrgData in order to satisfy tools that need this section.
39+
* Adding PrgData section in order to satisfy tools that need it.
4140
*/
4241
PrgData : {
42+
KEEP(*(.PrgData))
43+
KEEP(*(.PrgData.*))
44+
45+
. = ALIGN(4);
46+
}
47+
48+
DevDscr : {
4349
KEEP(*(.DevDscr))
4450
KEEP(*(.DevDscr.*))
4551

src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ pub struct FlashDevice {
7878
pub sectors: [u32; 4],
7979
}
8080

81+
#[cfg(feature = "device_description")]
82+
#[no_mangle]
83+
#[link_section = ".PrgData"]
84+
pub static dummy: u32 = 0;
85+
8186
#[cfg(feature = "device_description")]
8287
#[no_mangle]
8388
#[link_section = ".DevDscr"]

0 commit comments

Comments
 (0)