encounter / decomp-toolkit

A GameCube & Wii decompilation toolkit
Apache License 2.0
107 stars 15 forks source link

[BUG] failed to analyze Goldeneye Wii (SJBE52) #56

Open Coockie1173 opened 4 months ago

Coockie1173 commented 4 months ago

Repository URL

https://github.com/Coockie1173/Goldeneye-Wii

Game Name

GoldenEye Wii

Game Version

USA

Description

When splitting the game, it throws the following error:

build\tools\dtk.exe dol split config\SJBE52\config.yml build\SJBE52 INFO Loading config\SJBE52\config.yml INFO Loading and analyzing 1 module (using 1 thread) WARN module{name=main}: Control flow from 3:0x803AB514 hit known function 3:0x803AB55C (instruction: 3:0x803AB55C) INFO Initial analysis completed in 0.969s (found 14036 functions) INFO Rebuilding relocationninja: error: rebuilding 'build.ninja': subcommand failed s and splitting Failed: While processing object 'main.dol' (module ID 0)

encounter commented 4 months ago

It turns out this specific failure is because of a tricky linker flag: -code_merging all,aggressive

It causes issues with analysis and splitting, because .ctors entries were merged together, and I'll have to figure out how to automatically un-deduplicate(?) them, which would be required to build a matching DOL.

I sadly don't have an idea on how to accomplish it yet :(

Coockie1173 commented 4 months ago

It turns out this specific failure is because of a tricky linker flag: -code_merging all,aggressive

It causes issues with analysis and splitting, because .ctors entries were merged together, and I'll have to figure out how to automatically un-deduplicate(?) them, which would be required to build a matching DOL.

I sadly don't have an idea on how to accomplish it yet :(

hmm, I guess it's figuring out what the compiler would do in this situation right? If that's the case it might be a good idea to have a barebones project where you compile it twice, once merged and once not merged, to see how it behaves/differs. I'd setup the barebones project myself if I knew how to do it ;)