From bc9cf284e630c0197734e29f730a5138c28c2879 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 6 Nov 2021 21:33:59 -0500 Subject: [PATCH] use 2.6 linker --- Makefile | 7 +++---- asm/Dolphin/__ppc_eabi_init.s | 4 ++-- asm/Dolphin/abort_exit.s | 4 ++-- asm/JSystem/J2D/J2DMaterialFactory.s | 2 +- asm/JSystem/J3D/J3DMaterialFactory.s | 2 +- asm/JSystem/J3D/J3DMaterialFactory_v21.s | 2 +- asm/ctors.s | 2 +- asm/dtors.s | 2 +- asm/plugProjectKandoU/baseGameSection.s | 2 +- asm/plugProjectKandoU/itemUjamushi.s | 2 +- asm/plugProjectKandoU/onyonMgr.s | 2 +- asm/plugProjectKandoU/vsGameSection.s | 2 +- asm/plugProjectKonoU/khCaveResult.s | 2 +- asm/plugProjectKonoU/khDayEndResult.s | 2 +- asm/plugProjectKonoU/khWinLose.s | 2 +- asm/plugProjectNishimuraU/RandEnemyUnit.s | 2 +- asm/plugProjectNishimuraU/RandMapScore.s | 2 +- asm/plugProjectNishimuraU/ShadowCylinder.s | 2 +- asm/plugProjectOgawaU/ogTitleMsg.s | 2 +- ldscript.lcf | 7 +++++++ patch_linker.sh | 0 21 files changed, 30 insertions(+), 24 deletions(-) mode change 100644 => 100755 patch_linker.sh diff --git a/Makefile b/Makefile index a593a50af..d53b21312 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ O_FILES := $(GROUP_0_FILES) $(JSYSTEM) $(DOLPHIN)\ #------------------------------------------------------------------------------- MWCC_VERSION := 2.6 -MWLD_VERSION := 2.7e +MWLD_VERSION := 2.6 # Programs ifeq ($(WINDOWS),1) @@ -69,7 +69,7 @@ ifeq ($(WINDOWS),1) OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy.exe CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp.exe -P else - WINE := wine + WINE ?= wine AS := $(DEVKITPPC)/bin/powerpc-eabi-as OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp -P @@ -78,7 +78,7 @@ CC = $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe LD := $(WINE) tools/mwcc_compiler/$(MWLD_VERSION)/mwldeppc.exe ELF2DOL := tools/elf2dol SHA1SUM := sha1sum -PYTHON := python +PYTHON := python3 # POSTPROC := tools/postprocess.py @@ -132,7 +132,6 @@ tools: $(MAKE) -C tools $(ELF): $(O_FILES) $(LDSCRIPT) - ./$(PATCHLINKER) $(LD) 117 @echo $(O_FILES) > build/o_files $(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) @build/o_files # The Metrowerks linker doesn't generate physical addresses in the ELF program headers. This fixes it somehow. diff --git a/asm/Dolphin/__ppc_eabi_init.s b/asm/Dolphin/__ppc_eabi_init.s index 999e79fbb..4d089a2f2 100644 --- a/asm/Dolphin/__ppc_eabi_init.s +++ b/asm/Dolphin/__ppc_eabi_init.s @@ -48,8 +48,8 @@ __init_cpp: /* 800F2FD8 000EFF18 90 01 00 04 */ stw r0, 4(r1) /* 800F2FDC 000EFF1C 94 21 FF F0 */ stwu r1, -0x10(r1) /* 800F2FE0 000EFF20 93 E1 00 0C */ stw r31, 0xc(r1) -/* 800F2FE4 000EFF24 3C 60 80 47 */ lis r3, __init_cpp_exceptions_reference@ha -/* 800F2FE8 000EFF28 38 03 2F 00 */ addi r0, r3, __init_cpp_exceptions_reference@l +/* 800F2FE4 000EFF24 3C 60 80 47 */ lis r3, _ctors@ha +/* 800F2FE8 000EFF28 38 03 2F 00 */ addi r0, r3, _ctors@l /* 800F2FEC 000EFF2C 7C 1F 03 78 */ mr r31, r0 /* 800F2FF0 000EFF30 48 00 00 04 */ b lbl_800F2FF4 lbl_800F2FF4: diff --git a/asm/Dolphin/abort_exit.s b/asm/Dolphin/abort_exit.s index e7445f6ef..50da9a6a0 100644 --- a/asm/Dolphin/abort_exit.s +++ b/asm/Dolphin/abort_exit.s @@ -29,8 +29,8 @@ exit: /* 800C2484 000BF3C4 38 60 00 00 */ li r3, 0 /* 800C2488 000BF3C8 48 00 3D D1 */ bl __end_critical_region /* 800C248C 000BF3CC 4B FF F2 2D */ bl __destroy_global_chain -/* 800C2490 000BF3D0 3C 60 80 47 */ lis r3, __destroy_global_chain_reference@ha -/* 800C2494 000BF3D4 38 03 32 C0 */ addi r0, r3, __destroy_global_chain_reference@l +/* 800C2490 000BF3D0 3C 60 80 47 */ lis r3, _dtors@ha +/* 800C2494 000BF3D4 38 03 32 C0 */ addi r0, r3, _dtors@l /* 800C2498 000BF3D8 7C 1F 03 78 */ mr r31, r0 /* 800C249C 000BF3DC 48 00 00 10 */ b lbl_800C24AC lbl_800C24A0: diff --git a/asm/JSystem/J2D/J2DMaterialFactory.s b/asm/JSystem/J2D/J2DMaterialFactory.s index f7d52fc2a..a36a2c41b 100644 --- a/asm/JSystem/J2D/J2DMaterialFactory.s +++ b/asm/JSystem/J2D/J2DMaterialFactory.s @@ -9,7 +9,7 @@ lbl_805168D8: lbl_805168DC: .4byte 0xFFFFFFFF -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E40 lbl_80520E40: .skip 0x4 diff --git a/asm/JSystem/J3D/J3DMaterialFactory.s b/asm/JSystem/J3D/J3DMaterialFactory.s index 461de7406..476cd1512 100644 --- a/asm/JSystem/J3D/J3DMaterialFactory.s +++ b/asm/JSystem/J3D/J3DMaterialFactory.s @@ -171,7 +171,7 @@ lbl_80516A88: .4byte 0xFFFFFFFF .4byte 0x00000000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E48 lbl_80520E48: .skip 0x4 diff --git a/asm/JSystem/J3D/J3DMaterialFactory_v21.s b/asm/JSystem/J3D/J3DMaterialFactory_v21.s index 0c50152a3..5cf83e137 100644 --- a/asm/JSystem/J3D/J3DMaterialFactory_v21.s +++ b/asm/JSystem/J3D/J3DMaterialFactory_v21.s @@ -8,7 +8,7 @@ lbl_80516AE0: lbl_80516AE4: .4byte 0xFFFFFFFF -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E50 lbl_80520E50: .skip 0x4 diff --git a/asm/ctors.s b/asm/ctors.s index 8e7891175..359243eca 100644 --- a/asm/ctors.s +++ b/asm/ctors.s @@ -2,4 +2,4 @@ .section .ctors, "wa" # 0x80472F00 - 0x804732C0 .global __init_cpp_exceptions_reference __init_cpp_exceptions_reference: - #.4byte __init_cpp_exceptions + .4byte __init_cpp_exceptions diff --git a/asm/dtors.s b/asm/dtors.s index f96995d13..d8e685599 100644 --- a/asm/dtors.s +++ b/asm/dtors.s @@ -2,7 +2,7 @@ .section .dtors, "wa" # 0x804732C0 - 0x804732E0 .global __destroy_global_chain_reference __destroy_global_chain_reference: - #.4byte __destroy_global_chain + .4byte __destroy_global_chain .global __fini_cpp_exceptions_reference __fini_cpp_exceptions_reference: .4byte __fini_cpp_exceptions diff --git a/asm/plugProjectKandoU/baseGameSection.s b/asm/plugProjectKandoU/baseGameSection.s index 84f7639cb..4c9e15c35 100644 --- a/asm/plugProjectKandoU/baseGameSection.s +++ b/asm/plugProjectKandoU/baseGameSection.s @@ -833,7 +833,7 @@ lbl_805185B8: lbl_805185BC: .4byte 0x0D0A0000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E58 lbl_80520E58: .skip 0x4 diff --git a/asm/plugProjectKandoU/itemUjamushi.s b/asm/plugProjectKandoU/itemUjamushi.s index 077f40afc..60310430d 100644 --- a/asm/plugProjectKandoU/itemUjamushi.s +++ b/asm/plugProjectKandoU/itemUjamushi.s @@ -1122,7 +1122,7 @@ lbl_80519EA8: lbl_80519EB0: .float 0.35 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E80 lbl_80520E80: .skip 0x8 diff --git a/asm/plugProjectKandoU/onyonMgr.s b/asm/plugProjectKandoU/onyonMgr.s index f06d112cd..8ff97ec3f 100644 --- a/asm/plugProjectKandoU/onyonMgr.s +++ b/asm/plugProjectKandoU/onyonMgr.s @@ -1077,7 +1077,7 @@ lbl_80518B50: lbl_80518B58: .float 128000.0 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E60 lbl_80520E60: .skip 0x4 diff --git a/asm/plugProjectKandoU/vsGameSection.s b/asm/plugProjectKandoU/vsGameSection.s index 094d172c0..cbffc1015 100644 --- a/asm/plugProjectKandoU/vsGameSection.s +++ b/asm/plugProjectKandoU/vsGameSection.s @@ -494,7 +494,7 @@ lbl_80519580: .float 0.25 .4byte 0x00000000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E68 lbl_80520E68: .skip 0x4 diff --git a/asm/plugProjectKonoU/khCaveResult.s b/asm/plugProjectKonoU/khCaveResult.s index 2af9cc705..66cd4c0e6 100644 --- a/asm/plugProjectKonoU/khCaveResult.s +++ b/asm/plugProjectKonoU/khCaveResult.s @@ -291,7 +291,7 @@ lbl_80520030: lbl_80520034: .4byte 0x43700000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520EC0 lbl_80520EC0: .skip 0x4 diff --git a/asm/plugProjectKonoU/khDayEndResult.s b/asm/plugProjectKonoU/khDayEndResult.s index a82218890..b3e6c1512 100644 --- a/asm/plugProjectKonoU/khDayEndResult.s +++ b/asm/plugProjectKonoU/khDayEndResult.s @@ -763,7 +763,7 @@ lbl_80520178: .4byte 0x3F2E147B .4byte 0x00000000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520EC8 lbl_80520EC8: .skip 0x4 diff --git a/asm/plugProjectKonoU/khWinLose.s b/asm/plugProjectKonoU/khWinLose.s index 9dda15b45..3a5871f6a 100644 --- a/asm/plugProjectKonoU/khWinLose.s +++ b/asm/plugProjectKonoU/khWinLose.s @@ -177,7 +177,7 @@ lbl_80520238: .4byte 0x42700000 .4byte 0x00000000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520ED0 lbl_80520ED0: .skip 0x4 diff --git a/asm/plugProjectNishimuraU/RandEnemyUnit.s b/asm/plugProjectNishimuraU/RandEnemyUnit.s index 3973c00ad..d32b693e6 100644 --- a/asm/plugProjectNishimuraU/RandEnemyUnit.s +++ b/asm/plugProjectNishimuraU/RandEnemyUnit.s @@ -79,7 +79,7 @@ lbl_8051A7D0: lbl_8051A7D4: .float 0.5 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E90 lbl_80520E90: .skip 0x4 diff --git a/asm/plugProjectNishimuraU/RandMapScore.s b/asm/plugProjectNishimuraU/RandMapScore.s index 858a27df5..09d15ef25 100644 --- a/asm/plugProjectNishimuraU/RandMapScore.s +++ b/asm/plugProjectNishimuraU/RandMapScore.s @@ -82,7 +82,7 @@ lbl_8051A830: lbl_8051A834: .4byte 0x43160000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520EA8 lbl_80520EA8: .skip 0x4 diff --git a/asm/plugProjectNishimuraU/ShadowCylinder.s b/asm/plugProjectNishimuraU/ShadowCylinder.s index 5e3ab8daa..d286b2c70 100644 --- a/asm/plugProjectNishimuraU/ShadowCylinder.s +++ b/asm/plugProjectNishimuraU/ShadowCylinder.s @@ -237,7 +237,7 @@ lbl_8051A658: .4byte 0xFFFFFF7F .4byte 0x00000000 -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520E88 lbl_80520E88: .skip 0x8 diff --git a/asm/plugProjectOgawaU/ogTitleMsg.s b/asm/plugProjectOgawaU/ogTitleMsg.s index ca868251f..e6979edf2 100644 --- a/asm/plugProjectOgawaU/ogTitleMsg.s +++ b/asm/plugProjectOgawaU/ogTitleMsg.s @@ -196,7 +196,7 @@ lbl_8051E068: lbl_8051E06C: .4byte 0x3ECCCCCD -.section .sbss2 # 0x80520e40 - 0x80520ED8 +.section .sbss2, "", @nobits # 0x80520e40 - 0x80520ED8 .global lbl_80520EB8 lbl_80520EB8: .skip 0x2 diff --git a/ldscript.lcf b/ldscript.lcf index b45e31637..9686a0b6e 100644 --- a/ldscript.lcf +++ b/ldscript.lcf @@ -54,3 +54,10 @@ GROUP: { _size_sbss_reduced = _size_sbss-0x1C; _size_sdata2_reduced = _size_sdata2-0x10; } + +FORCEFILES { + __init_cpp_exceptions.o + ebiP2TitleCamera.o + ctors.o + dtors.o +} diff --git a/patch_linker.sh b/patch_linker.sh old mode 100644 new mode 100755