From 2c481eaeebcfe2d78efa305d3e1b908100bebf14 Mon Sep 17 00:00:00 2001 From: Tharo Date: Wed, 6 May 2026 22:33:03 +0100 Subject: Partial linking of spec segments (#2661) * Partial linking of overlay segments, relax linker script alignment * Partial linking of all spec segments * Fix update, remove _RomPos from linker script * iQue version working pending COM-plugin update * Add plf map file resolution to sym_info.py, local symbol merging is broken * git subrepo pull tools/com-plugin subrepo: subdir: "tools/com-plugin" merged: "c4f3ba845" upstream: origin: "git@github.com:Thar0/com-plugin.git" branch: "main" commit: "c4f3ba845" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb" * Make tools compatible with partial linking Co-authored-by: Anghelo Carvajal * Remove unused files * Fix some makefile bits * mkspecrules cleanup * Comment on the makerom linker layout in mkldscript * Revert linker padding strategy back to pad_text spec directives * Comment on objcopy elf -> rom step * Adjust tool descriptions * Fix compressed builds * rm reloc_prereq, no longer used * Makefile merge fix Co-authored-by: Dragorn421 --------- Co-authored-by: Anghelo Carvajal Co-authored-by: Dragorn421 --- first_diff.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'first_diff.py') diff --git a/first_diff.py b/first_diff.py index 65dcf1b78..167fbe103 100755 --- a/first_diff.py +++ b/first_diff.py @@ -26,6 +26,13 @@ def decodeInstruction(bytesDiff: bytes, mapFile: mapfile_parser.MapFile) -> str: return instr.disassemble(immOverride=immOverride, extraLJust=-20) +def plfResolver(x: Path) -> Path|None: + if x.suffix == ".plf": + plf_map_path = x.with_suffix(".map") + if plf_map_path.exists(): + return plf_map_path + return None + def firstDiffMain(): parser = argparse.ArgumentParser(description="Find the first difference(s) between the built ROM and the base ROM.") @@ -43,7 +50,11 @@ def firstDiffMain(): EXPECTEDROM = Path(f"baseroms/{args.oot_version}/baserom-decompressed.z64") EXPECTEDMAP = "expected" / BUILTMAP - mapfile_parser.frontends.first_diff.doFirstDiff(BUILTMAP, EXPECTEDMAP, BUILTROM, EXPECTEDROM, args.count, mismatchSize=True, addColons=args.add_colons, bytesConverterCallback=decodeInstruction) + mapfile_parser.frontends.first_diff.doFirstDiff(BUILTMAP, EXPECTEDMAP, BUILTROM, EXPECTEDROM, args.count, + mismatchSize=True, addColons=args.add_colons, + bytesConverterCallback=decodeInstruction, + plfResolver=plfResolver, + plfResolverExpected=plfResolver) if __name__ == "__main__": firstDiffMain() -- cgit v1.2.3