Allow overlapping Overlays

This commit is contained in:
Jaby
2023-01-22 16:37:36 +01:00
parent ffc0666935
commit 204760b4bd
5 changed files with 53 additions and 71 deletions

View File

@@ -62,7 +62,7 @@ CCFLAGS += -DJABYENGINE_$(TV_FORMAT)
#Linker flags
LDFLAGS_release += -Os
LDFLAGS_all += -Wl,-Map=$(TARGET).map -nostdlib -T$(AUTO_OVERLAY_DIR)/Overlays.ld -T$(JABY_ENGINE_DIR)/lib/psexe.ld -static -Wl,--gc-sections -Wl,--build-id=none
LDFLAGS_all += -Wl,-Map=$(TARGET).map -nostdlib -T$(AUTO_OVERLAY_DIR)/Overlays.ld -T$(JABY_ENGINE_DIR)/lib/psexe.ld -static -Wl,--gc-sections -Wl,--build-id=none -Wl,--no-check-sections
LDFLAGS_all += $(ARCHFLAGS) -Wl,--oformat=$(FORMAT)
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))

View File

@@ -34,6 +34,7 @@ TLOAD_ADDR = DEFINED(TLOAD_ADDR) ? TLOAD_ADDR : 0x80010000;
MEMORY {
loader : ORIGIN = (TLOAD_ADDR - 0x800), LENGTH = 2048
ram (rwx) : ORIGIN = 0x80010000, LENGTH = 2M - 0x10000
ram2 (rwx) : ORIGIN = 0x80010000, LENGTH = 2M - 0x10000
dcache : ORIGIN = 0x1f800000, LENGTH = 0x400
}
@@ -60,6 +61,39 @@ SECTIONS {
}
/*Overlay sections created by mkoverlay*/
SECTIONS {
.planschi __bss_end : SUBALIGN(4)
{
__planschi_start = .;
__boot_loader_start = .;
*libJabyEngine.a:*_boot.o(.text.startup._GLOBAL__*)
*_boot.o(.text.startup._GLOBAL__*)
*libJabyEngine.a:*_boot.o(.ctors)
*_boot.o(.ctors)
*libJabyEngine.a:*_boot.o(.text.*)
*_boot.o(.text.*)
*libJabyEngine.a:*_boot.o(.rodata*)
*_boot.o(.rodata*)
*libJabyEngine.a:*_boot.o(.sdata*)
*_boot.o(.sdata*)
*libJabyEngine.a:*_boot.o(.data*)
*_boot.o(.data*)
*libJabyEngine.a:*_boot.o(.sbss*)
*_boot.o(.sbss*)
*libJabyEngine.a:*_boot.o(.bss*)
*_boot.o(.bss*)
*libJabyEngine.a:*_boot.o(*)
*_boot.o(*)
. = ALIGN(4);
__boot_loader_end = .;
/*Only needed for the PSX BIOS to load the entire game*/
. = ALIGN(2048);
__planschi_end = .;
}
}
SECTIONS {
.PSX_EXE_Header : {
@@ -181,7 +215,7 @@ SECTIONS {
__data_end = .;
__fdata_end = .;
__bss_start = .;
.sbss : {
.bss : {
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)