/* Memory Layout (128MB Userspace):
 * User RAM: 0x88000000 - 0x8FFFFFFF (128MB)
 * Stack starts at 0x8FFFFFE0 and grows down
 * Requires QEMU -m 256M to ensure valid physical backing
 */
MEMORY
{
    RAM (rwx) : ORIGIN = 0x88000000, LENGTH = 128M
}

SECTIONS
{
    . = 0x88000000;

    .text : {
        *(.text._start)
        *(.text)
        *(.text.*)
    } > RAM

    .rodata : {
        *(.rodata)
        *(.rodata.*)
    } > RAM

    .sdata : {
        __global_pointer$ = . + 0x800;
        *(.sdata .sdata.* .srodata .srodata.*)
    } > RAM

    .data : {
        *(.data)
        *(.data.*)
    } > RAM

    .nexus.manifest : {
        KEEP(*(.nexus.manifest))
    } > RAM

    .bss : {
        . = ALIGN(8);
        __bss_start = .;
        *(.bss)
        *(.bss.*)
        *(COMMON)
        . = ALIGN(8);
        __bss_end = .;
    } > RAM
}
