From 8b198cf9d29229dbb83af5c0a489009a0053048c Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Thu, 12 Sep 2024 16:15:01 +0900 Subject: [PATCH] Fix alignment for bins (#1201) --- tools/build/configure.py | 10 ++++++---- ver/jp/splat.yaml | 2 -- ver/pal/splat.yaml | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/build/configure.py b/tools/build/configure.py index f8f3711123..61bb576432 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -66,6 +66,8 @@ def write_ninja_rules( cc_egcs = f"{cc_egcs_dir}/gcc" cxx = f"{BUILD_TOOLS}/cc/gcc/g++" + BFDNAME = "elf32-tradbigmips" + CPPFLAGS_COMMON = ( "-Iver/$version/include -Iver/$version/build/include -Iinclude -Isrc -Iassets/$version -D_LANGUAGE_C -D_FINALROM " "-DVERSION=$version -DF3DEX_GBI_2 -D_MIPS_SZLONG=32" @@ -166,13 +168,13 @@ def write_ninja_rules( ninja.rule( "cc_272", description="cc_272 $in", - command=f"bash -o pipefail -c 'COMPILER_PATH={cc_272_dir} {cc_272} {CPPFLAGS_272} {extra_cppflags} $cppflags {cflags_272} $cflags $in -o $out && mips-linux-gnu-objcopy -N $in $out'", + command=f"bash -o pipefail -c 'COMPILER_PATH={cc_272_dir} {cc_272} {CPPFLAGS_272} {extra_cppflags} $cppflags {cflags_272} $cflags $in -o $out && {cross}objcopy -N $in $out'", ) ninja.rule( "cc_egcs", description="cc_egcs $in", - command=f"bash -o pipefail -c '{cc_egcs} {CPPFLAGS_EGCS} {extra_cppflags} $cppflags {cflags_egcs} $cflags $in -o $out && mips-linux-gnu-objcopy -N $in $out && python3 ./tools/patch_64bit_compile.py $out'", + command=f"bash -o pipefail -c '{cc_egcs} {CPPFLAGS_EGCS} {extra_cppflags} $cppflags {cflags_egcs} $cflags $in -o $out && {cross}objcopy -N $in $out && python3 ./tools/patch_64bit_compile.py $out'", ) ninja.rule( @@ -186,13 +188,13 @@ def write_ninja_rules( ninja.rule( "dead_cc_fix", description="dead_cc_fix $in", - command=f"mips-linux-gnu-objcopy --redefine-sym sqrtf=dead_sqrtf $in $out", + command=f"{cross}objcopy --redefine-sym sqrtf=dead_sqrtf $in $out", ) ninja.rule( "bin", description="bin $in", - command=f"{ld} -r -b binary $in -o $out", + command=f"{cross}objcopy -I binary -O {BFDNAME} --set-section-alignment .data=8 $in $out", ) ninja.rule( diff --git a/ver/jp/splat.yaml b/ver/jp/splat.yaml index 61ad27d5a1..1ec658446f 100644 --- a/ver/jp/splat.yaml +++ b/ver/jp/splat.yaml @@ -10194,8 +10194,6 @@ segments: start: 0xE272F0 vram: 0x80240000 - - [ 0xE28FA0, bin ] - - type: code name: inspect_icon start: 0xE28FA0 diff --git a/ver/pal/splat.yaml b/ver/pal/splat.yaml index c384529c86..065fcde8ed 100644 --- a/ver/pal/splat.yaml +++ b/ver/pal/splat.yaml @@ -1075,8 +1075,6 @@ segments: start: 0x25C5A0 # TODO: split into images - - [0x2705A0, bin] - - start: 0x2705A0 type: pm_imgfx_data name: imgfx_data @@ -12129,9 +12127,7 @@ segments: - [0xE8AFB0, c, settings] - [0xE8AFB0, c, main] - # todo: add heaps2 - - [0xE8D120, bin] - type: code start: 0xE8D120