From 31f7ff89948720b51cddbb12e879f4d300cf0eda Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 27 Aug 2023 16:45:56 +0200 Subject: [PATCH] Finalize linker script --- lib/psexe.ld | 9 +++++---- src/Tools/mkoverlay/Cargo.toml | 2 +- src/Tools/mkoverlay/src/creator/ldscript.rs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/psexe.ld b/lib/psexe.ld index bdec0f2f..441541ec 100644 --- a/lib/psexe.ld +++ b/lib/psexe.ld @@ -31,9 +31,10 @@ ENTRY(_ZN10JabyEngine5startEv) TLOAD_ADDR = DEFINED(TLOAD_ADDR) ? TLOAD_ADDR : 0x80010000; MEMORY { - loader : ORIGIN = (TLOAD_ADDR - 0x800), LENGTH = 2048 - ram (rwx) : ORIGIN = 0x80010000, LENGTH = 2M - 0x10000 - dcache : ORIGIN = 0x1f800000, LENGTH = 0x400 + loader : ORIGIN = (TLOAD_ADDR - 0x800), LENGTH = 2048 + ram(rwx) : ORIGIN = 0x80010000, LENGTH = 2M - 0x10000 + ram_alt(rwx) : ORIGIN = 0x80010000, LENGTH = 2M - 0x10000 + dcache : ORIGIN = 0x1f800000, LENGTH = 0x400 } __ram_top = ORIGIN(ram) + LENGTH(ram); @@ -92,7 +93,7 @@ SECTIONS { /*Only needed for the PSX BIOS to load the entire game*/ . = ALIGN(2048); __planschi_end = .; - } + } > ram_alt } SECTIONS { diff --git a/src/Tools/mkoverlay/Cargo.toml b/src/Tools/mkoverlay/Cargo.toml index 569ece16..89fc9d9e 100644 --- a/src/Tools/mkoverlay/Cargo.toml +++ b/src/Tools/mkoverlay/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mkoverlay" -version = "1.5.0" +version = "1.5.1" edition = "2021" [profile.release] diff --git a/src/Tools/mkoverlay/src/creator/ldscript.rs b/src/Tools/mkoverlay/src/creator/ldscript.rs index a553987a..e276e860 100644 --- a/src/Tools/mkoverlay/src/creator/ldscript.rs +++ b/src/Tools/mkoverlay/src/creator/ldscript.rs @@ -19,7 +19,7 @@ pub fn write(output: &mut Output, overlay_desc: &OverlayDesc) -> Result<(), Erro writeln!(output, "\t/*{}*/", slot.name)?; writeln!(output, "\tOVERLAY {} : NOCROSSREFS SUBALIGN(4) {{", slot_start_adr)?; write_section(output, &slot.sections, false)?; - writeln!(output, "\t}} > ram")?; + writeln!(output, "\t}} > ram_alt")?; writeln!(output, "\t. = ALIGN(4);")?; writeln!(output, concat!("\t", section_end_name_template!(), " = .;"), slot.name)?; writeln!(output, "")?;