Skip to content

Commit

Permalink
Fix alignment for bins (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethteck authored Sep 12, 2024
1 parent 1bcc4ff commit 8b198cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
10 changes: 6 additions & 4 deletions tools/build/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions ver/jp/splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10194,8 +10194,6 @@ segments:
start: 0xE272F0
vram: 0x80240000

- [ 0xE28FA0, bin ]

- type: code
name: inspect_icon
start: 0xE28FA0
Expand Down
4 changes: 0 additions & 4 deletions ver/pal/splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,6 @@ segments:
start: 0x25C5A0
# TODO: split into images

- [0x2705A0, bin]

- start: 0x2705A0
type: pm_imgfx_data
name: imgfx_data
Expand Down Expand Up @@ -12129,9 +12127,7 @@ segments:
- [0xE8AFB0, c, settings]
- [0xE8AFB0, c, main]


# todo: add heaps2
- [0xE8D120, bin]

- type: code
start: 0xE8D120
Expand Down

0 comments on commit 8b198cf

Please sign in to comment.