AetiasHax / ph

Decompilation of The Legend of Zelda: Phantom Hourglass
17 stars 2 forks source link

Add `elfkill`, document the build system #35

Closed AetiasHax closed 7 months ago

AetiasHax commented 7 months ago

I've implemented elfkill, a postprocessing tool that locates function names in macros like KILL(_ZN11ItemManager6CreateEv) and renames such functions' sections from .text to .dead. This effectively excludes the functions from being linked.

This will help us to manually kill implicitly generated functions such as ctors/dtors that were otherwise removed via the -dead linker option. We do not want to enable this option, as it currently kills many other functions that are meant to be in the game.

In addition, I thought it might be helpful or interesting to document the build system, from start to finish, with examples. This document will be updated as things change in the future.