dreamcast/loader.lds
Zack Buhman d912278afd serial_transfer: self-relocate to the end of system memory
The serial_transfer loader, as long as the target program voluntarily
terminates itself at some point, is able to load multiple programs
consecutively without requiring a physical power cycle to reload the
transfer program from CD.

The current example.mk juggles between two different "memory layouts",
one for "burn to a physical CD" and another for "load via serial
cable". Because the serial_transfer program now relocates itself to
the end of system memory, this means the 0x8c010000 area is now usable
by programs that are loaded by serial_transfer.
2024-03-13 20:56:37 +08:00

62 lines
1.0 KiB
Plaintext

OUTPUT_FORMAT("elf32-shl", "elf32-shl", "elf32-shl")
MEMORY
{
p1ram : ORIGIN = 0x8c020000, LENGTH = 0xfe0000
p2ram : ORIGIN = 0xac020000, LENGTH = 0xfe0000
ldram : ORIGIN = 0x8cfff000, LENGTH = 0x1000
}
SECTIONS
{
. = ORIGIN(p2ram);
.text.startup ALIGN(4) : SUBALIGN(4)
{
KEEP(*(.text.start))
*(.text.startup.*)
. = ALIGN(4);
} > p2ram AT> p2ram
.ctors ALIGN(4) : SUBALIGN(4)
{
KEEP(*(.ctors))
KEEP(*(.ctors.*))
. = ALIGN(4);
} > p2ram AT> p2ram
. = ORIGIN(ldram);
.text ALIGN(4) : SUBALIGN(4)
{
*(.text.*)
*(.text)
. = ALIGN(4);
} > ldram AT> p2ram
.data ALIGN(4) : SUBALIGN(4)
{
*(.data)
*(.data.*)
. = ALIGN(4);
} > ldram AT> p2ram
.rodata ALIGN(4) : SUBALIGN(4)
{
*(.rodata)
*(.rodata.*)
. = ALIGN(4);
} > ldram AT> p2ram
.bss ALIGN(4) (NOLOAD) : SUBALIGN(4)
{
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(4);
} > ldram
INCLUDE "debug.lds"
}
__stack_reservation = 0x0000;
INCLUDE "symbols.lds"
INCLUDE "addresses.lds"