Open Thar0 opened 1 week ago
Sounds like an interesting solution to the partial linking issue. I'll try to play with this idea during this week.
btw, Is plf
an standard extension? And what does it mean? "Partial linked file"?
It reminds me to the plf
s elf files found on the Gamecube Nintendo Puzzle Collection disc.
$ file Dr_MARIO.plf
Dr_MARIO.plf: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SYSV), not stripped
Sorry for the late response, I have been busy irl
Explain the feature
I'm (again) experimenting with partial linking in OoT, where each spec segment is partially linked into an intermediate file before final link. For example the
code
segment would be linked intobuild/segments/code.plf
andovl_kaleido_scope
intobuild/segments/ovl_kaleido_scope.plf
. This however makes sym_info and first_diff less accurate with their file reporting:Each .plf will have it's own .map file in
buid/segments/
as well, so it would be nice if these tools could read those map files to find the specific .o file that a symbol originated in.Edit: I've pushed a branch where I've been experimenting if you want to check it out in context https://github.com/Thar0/oot/tree/partial-linking
Advantage
It would make the tools more compatible with partial linking.
Disadvantage
Probably nothing, it should be possible to make the default behavior the same as before this feature is added.
Example(s)
I was thinking there could be a dictionary that associates a file suffix with a function
resolver(Path) -> Path
that maps the input object file path to an output map file path to read:Any object file name that matches one of these suffixes in the originally opened map file will have the associated secondary map opened and the filename in that map reported instead.
For example
The resolver would transform
build/gc-eu-mq-dbg/segments/code.plf
->build/gc-eu-mq-dbg/segments/code.map
, read code.map from that path, probably do some sort of vram adjustment since the plf map files start at vram 0, and find.text 0x00000000000b39b0 0x25e0 build/gc-eu-mq-dbg/src/code/sys_matrix.o
is the object file that containsMatrix_MultVec3f
, and display that instead of code.plf