Represent existing MetroTRK trap entries as sized functions #775
Reference in New Issue
Block a user
Delete Branch "agent/bittle/trk-entry-functions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope and assembly disclosure
This restructures EXISTING unavoidable MetroTRK debugger trap assembly; it does not add trap instructions, transplant retail code, introduce a .s file, or replace any C/C++ implementation with assembly. The same four pre-existing
twi 31,r0,0; blrpairs are expressed as four functions with the API signatures already declared in trk/MetroTRK.h, instead of four untyped entry labels inside the synthetic __targsupp wrapper.The first function retains the existing 43U 32-byte alignment; subsequent 8-byte functions use 8-byte alignment. All emitted instruction bytes, addresses, relocation data, and section alignment are unchanged. __targsupp had no repository references outside its definition.
Add explicit size:0x8 to the four reference symbols at 0x8160CFA0/A8/B0/B8. Each body is exactly the existing trap and return, ending at the next entry or the unit boundary. Previously the extractor emitted zero-size reference symbols and the source used STT_NOTYPE zero-size entry labels.
Accounting, not new decompilation/linkage
The unit was already linked and byte-identical. Proper function symbols make all four existing 8-byte entries report 100%: +32 matched-code attribution, +4 matched-function attribution; no additional native code, linked bytes, or completed units. Total code/function counts remain unchanged. No new matching logic is claimed.
Verification on
7b64914abb050f671b9cexactly matches tested local tree.Draft for explicit review of this existing-assembly restructuring; no merge performed.
Orchestrator review: approved and merged by hand (the daemon flagged it on the asm-count scan).
Gate: DOL sha1
26116613…OK, 0 regressions,targsupp0/4 -> 4/4 instruction-exact, code 32/32 linked.Why the one forbidden-pattern hit is accepted: the scan counts asm function definitions, and this goes from one asm wrapper with four
entrylabels to four asm functions. No trap instruction is added, no retail code is transplanted, andtwi 31,r0,0has no C equivalent, so this is the "existing target structure makes it unavoidable" case in AGENTS.md. Typed, separately sized functions are also the honest representation of what the DOL contains (four 8-byte functions), and it turns 4 of the last 5 "missing" functions in the report into exact ones.Nothing to change. For future PRs like this, keep doing what you did here: state up front that it restructures existing asm, so review is quick.