NuggetQ : Changing the Load Address of a PSX exe

In order to change the Load Memory Address (LMA) of your psx executable, you should use one of those solutions ;

$ file Sony Playstation executable PC=0x8001f000, .text=[0x8001f000,0x1c000], Stack=0x801fff00, ()

From the command line

When compiling, use the following command :

LDFLAGS ="-Xlinker --defsym=TLOAD_ADDR=0x80010000" make

From the Makefile

In the project's makefile, add the following line :

LDFLAGS += -Xlinker --defsym=TLOAD_ADDR=0x80010000

With an ld script

In the project's Makefile, add a line to include the ld script:

OVERLAYSCRIPT  ?= script.ld

in the linked script, add the following lines :

TLOAD_ADDR = 0x8001f000; /*Changes the PC*/
__heap_base = 0x8001f000; /* Build fails if not provided */