zeldaret / tww

Decompilation of The Legend of Zelda: The Wind Waker
https://zeldaret.github.io/tww
Creative Commons Zero v1.0 Universal
315 stars 47 forks source link

d_a_obj_eskban #653

Closed Aelire closed 5 months ago

Aelire commented 6 months ago

weak functions are in the right order with nosyminline on, but the sections don't match, and there are some destructors (cCcD_SphAttr, cCcD_CylAttr, dCcD_Stts, cCcD_Stts, dBgS_MoveBgActor) that appear in objdiff but marked UNUSED in the .map files. I don't know what's up with that

Had to add some padding for the bss size to match

389

LagoLunatic commented 6 months ago

Have you tried marking it as "Matching" in configure.py? In theory it should match fine if all the functions are at 100% and they're in the right order. The section splitting being different doesn't affect the binary, and those destructors you listed are stripped out by the linker.

Aelire commented 6 months ago

I hadn't tried that, didn't realize it added more checks Unfortunately it doesn't match, I misread and there is actually one function in the wrong place, dBgS_MoveBgActor::Draw and daObjEskban::<unnamed>::Mthd_IsDelete are swapped.

thanks for the explanations for the destructors btw, so if I understand correctly objdiff is comparing a built but not linked object, with an object reconstructed from debug info + the linked .rel, so anything thrown out by the linker would show as a mismatch in objdiff I guess? But I could bindiff the final rel inside build/ with the original extracted(+decompressed) rel to check matching to be sure

LagoLunatic commented 6 months ago

hadn't tried that, didn't realize it added more checks Unfortunately it doesn't match, I misread and there is actually one function in the wrong place, dBgS_MoveBgActor::Draw and daObjEskban::<unnamed>::Mthd_IsDelete are swapped.

same issue as obj_ladder and obj_mtest then

thanks for the explanations for the destructors btw, so if I understand correctly objdiff is comparing a built but not linked object, with an object reconstructed from debug info + the linked .rel, so anything thrown out by the linker would show as a mismatch in objdiff I guess?

yes

But I could bindiff the final rel inside build/ with the original extracted(+decompressed) rel to check matching to be sure

yep, for RELs that's how you tell what differences are introduced during linking. for main.dol, you can just run ninja diff