portal64-still-alive/portal.ld
2022-02-27 16:41:51 -07:00

72 lines
1.6 KiB
Plaintext

OUTPUT_ARCH (mips)
#define BEGIN_SEG(name, addr) \
_##name##SegmentStart = ADDR(.name); \
_##name##SegmentRomStart = __romPos; \
.name addr : AT(__romPos)
#define END_SEG(name) \
_##name##SegmentEnd = ADDR(.name) + SIZEOF(.name); \
_##name##SegmentRomEnd = __romPos + SIZEOF(.name); \
__romPos += SIZEOF(.name);
#define BEGIN_NOLOAD(name) \
_##name##SegmentBssStart = ADDR(.name.noload); \
.name.noload (NOLOAD) :
#define END_NOLOAD(name) \
_##name##SegmentBssEnd = ADDR(.name.noload) + SIZEOF(.name.noload); \
_##name##SegmentBssSize = SIZEOF(.name.noload);
SECTIONS
{
__romPos = 0;
BEGIN_SEG(boot, 0x04000000)
{
build/asm/rom_header.o(.text);
build/boot.6102.o(.data);
}
END_SEG(boot)
BEGIN_SEG(code, 0x80000400) SUBALIGN(16)
{
build/asm/entry.o(.text);
CODE_SEGMENT(.text);
/usr/lib/n64/PR/rspboot.o(.text);
/usr/lib/n64/PR/gspF3DEX2.fifo.o(.text);
/usr/lib/n64/PR/aspMain.o(.text);
/* data */
CODE_SEGMENT(.data*);
/usr/lib/n64/PR/rspboot.o(.data*);
/usr/lib/n64/PR/gspF3DEX2.fifo.o(.data*);
/usr/lib/n64/PR/aspMain.o(.data*);
/* rodata */
CODE_SEGMENT(.rodata*);
}
END_SEG(code)
BEGIN_NOLOAD(code)
{
CODE_SEGMENT(COMMON);
CODE_SEGMENT(.scommon*);
CODE_SEGMENT(.bss*);
. = ALIGN(0x8);
}
END_NOLOAD(code)
_codeSegmentBssEnd = .;
_heapStart = .;
. = 0x80200000;
/* Discard everything not specifically mentioned above. */
/DISCARD/ :
{
*(.eh_frame)
*(.MIPS.abiflags)
}
}