Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions runtime/ngdevkit.ld
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ SECTIONS {
* reference is not resolved properly by the MEMORY command
*/
rom_backup_data_address = DEFINED(rom_backup_data_address)? rom_backup_data_address : 0x100000;

/* Catch overridden backup-RAM placements that would land outside the
* 60 KB of m68k work RAM. Without these guards, ld would silently lay
* out .bss.bram at whatever address was given and the runtime would
* read/write garbage on access. */
ASSERT(rom_backup_data_address >= ORIGIN(RAM),
"rom_backup_data_address is below RAM origin (0x100000)")
ASSERT(rom_backup_data_address + LENGTH(BRAM) <= ORIGIN(RAM) + LENGTH(RAM),
"rom_backup_data_address + BRAM length (0x1000) extends past RAM end")

.bss.bram rom_backup_data_address : SUBALIGN(0) {
*(.bss.bram)
. = ALIGN(4);
Expand Down