pokediamond/ld_script.txt
ProjectRevoTPP 5343a230fe merge
2020-04-15 11:57:58 -04:00

66 lines
1.4 KiB
Plaintext

/* Linker Script to build Pokemon Diamond */
#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); \
_##name##SegmentSize = SIZEOF(.name); \
__romPos += SIZEOF(.name);
SECTIONS {
__romPos = 0;
BEGIN_SEG(header, 0x0)
{
build/asm/rom_header.o(.text);
}
END_SEG(header)
__romPos += 0x3E00;
BEGIN_SEG(arm9, 0x2000000)
{
build/asm/secure.o(.text);
build/asm/entry.o(.text);
build/asm/main.o(.text);
build/src/sub_02000DF4.o(.text);
build/asm/arm9_thumb.o(.text);
build/asm/rom2.o(.text);
}
END_SEG(arm9)
BEGIN_SEG(rom3, 0x2000000 + SIZEOF(arm9))
{
build/asm/rom3.o(.text);
}
END_SEG(rom3)
BEGIN_SEG(gap1, 0x2000000 + SIZEOF(rom3) + SIZEOF(arm9))
{
build/asm/gap1.o(.text);
}
END_SEG(gap1)
BEGIN_SEG(arm7, 0x02380000)
{
build/asm/arm7_rom.o(.text);
}
END_SEG(arm7)
BEGIN_SEG(gap2, 0x02380000 + SIZEOF(arm7))
{
build/asm/gap2.o(.text)
}
END_SEG(gap2)
. = 0x336400;
BEGIN_SEG(FileNameTable, 0x02400000)
{
build/asm/filenametable.o(.text);
}
END_SEG(FileNameTable)
}