More Linker Script improvements

This commit is contained in:
jaby 2022-08-29 08:43:59 +02:00
parent fe8ed935e1
commit 2747433c7f
1 changed files with 19 additions and 12 deletions

View File

@ -52,21 +52,36 @@ __stack_start = ORIGIN(ram) + LENGTH(ram);
__heap_base = __planschi_end;
SECTIONS {
__planschi_start = .;
/DISCARD/ : { *(.MIPS.abiflags) }
/* Everything is statically linked, so discard PLTs. */
/DISCARD/ : { *(.rel.iplt) *(.rela.iplt) *(.rel.plt) *(.rela.plt) *(.plt) *(.iplt) }
/* Discard things that the standard link script drops, too. */
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu.*) *(.comment) }
}
SECTIONS {
__boot_loader_start = .;
__planschi_start = .;
OVERLAY __bss_end : NOCROSSREFS SUBALIGN(4)
{
.planschi
{
*libJabyEngine.a:start.o(.text.startup._GLOBAL__*)
*libJabyEngine.a:start.o(.ctors)
*libJabyEngine.a:start.o(.text.*)
*libJabyEngine.a:start.o(*)
/* Old order
*libJabyEngine.a:start.o(.text.*)
*libJabyEngine.a:start.o(.rodata*)
*libJabyEngine.a:start.o(.sdata*)
*libJabyEngine.a:start.o(.data*)
*libJabyEngine.a:start.o(.sbss*)
*libJabyEngine.a:start.o(.bss*)
*libJabyEngine.a:start.o(.bss*)*/
}
}
__boot_loader_end = .;
/*Only needed for the PSX BIOS to load the entire game*/
. = ALIGN(2048);
__planschi_end = .;
@ -207,12 +222,4 @@ SECTIONS {
. = ADDR(.text) - 0x800;
__end = .;
/DISCARD/ : { *(.MIPS.abiflags) }
/* Everything is statically linked, so discard PLTs. */
/DISCARD/ : { *(.rel.iplt) *(.rela.iplt) *(.rel.plt) *(.rela.plt) *(.plt) *(.iplt) }
/* Discard things that the standard link script drops, too. */
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}