Linker Script for PSX

This commit is contained in:
Jaby 2022-08-28 19:35:30 +02:00
parent 3e096e9ea1
commit d69e7e9162
3 changed files with 30 additions and 8 deletions

View File

@ -1 +1 @@
__heap_base = __bss_end;
__heap_base = __bss_end;

View File

@ -45,10 +45,33 @@ __dcache_top = ORIGIN(dcache) + LENGTH(dcache);
__bss_len = (__bss_end - __bss_start);
__ftext_len = (__ftext_end - __ftext_start);
__fdata_len = (__fdata_end - __fdata_start);
__fdata_len = (__planschi_end - __fdata_start);
__stack_start = ORIGIN(ram) + LENGTH(ram);
__heap_base = __planschi_end;
SECTIONS {
__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(.rodata*)
*libJabyEngine.a:start.o(.sdata*)
*libJabyEngine.a:start.o(.data*)
*libJabyEngine.a:start.o(.sbss*)
*libJabyEngine.a:start.o(.bss*)
}
}
/*Only needed for the PSX BIOS to load the entire game*/
. = ALIGN(2048);
__planschi_end = .;
}
SECTIONS {
.PSX_EXE_Header : {
/*
@ -164,14 +187,12 @@ SECTIONS {
*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
*(.got.plt)
*(.got)
/* pad file to be a multiple of 2048 bytes. Needed for loading from CD-ROM. */
. = ALIGN(2048);
} > ram
__data_end = .;
__data_end = .;
__fdata_end = .;
__bss_start = .;
.sbss (NOLOAD) : {
.sbss : {
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
@ -182,7 +203,6 @@ SECTIONS {
. = ALIGN(4);
__bss_end = .;
__heap_start = __heap_base;
. = ADDR(.text) - 0x800;

View File

@ -1,6 +1,8 @@
#include <stdio.h>
int x = 0;
void _start() {
//call main here
printf("Hello Planschbecken c:\n");
printf("Hello Planschbecken c: %i\n", x);
}