Skip to content

Commit c839f21

Browse files
committed
Add dummy PrgData section and move device description to DevDescr section
1 parent 0c20b08 commit c839f21

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
@@ -169,6 +169,11 @@ pub struct FlashDevice {
169169
pub sectors: [u32; 4],
170170
}
171171

172+
#[cfg(feature = "device_description")]
173+
#[no_mangle]
174+
#[link_section = ".PrgData"]
175+
pub static dummy: u32 = 0;
176+
172177
#[cfg(feature = "device_description")]
173178
#[no_mangle]
174179
#[link_section = ".DevDscr"]

0 commit comments

Comments
 (0)