Repository navigation
Conversation
locate_extab_extabindex() probes for _eti_init_info starting at
section_end - ETI_INIT_INFO_SIZE * (num_text_sections + 1) and walks forward, reading
a candidate table at each address. A section's size can stop short of the next
section: sizes come from _rom_copy_info, whose values are rounded differently from the
file's. The first candidate then lands in the gap, read_eti_init_info() fails with
"Failed to locate section @ <addr>", and the `?` on it abandoned the search for the
whole program -- so extab/extabindex were never named.
The result is a game that splits with no exception-table splits at all, or, once
anything names extabindex, a hard failure: "Failed to find extab section".
Clamp the first candidate to the section start, and treat an unreadable candidate as
"not this one" instead of aborting. Also give the end-of-table read in the second loop
a message that says what it was doing.
Reproduced with v1.8.4 on Sonic Adventure 2 Battle's DOL ("Failed to locate section @
0x80173124", the program has no extab) and on a DOL with Animal Crossing's section
layout (.init 0x80003100 stopping at 0x800055F0, extab 0x80005620, extabindex
0x80005660, _eti_init_info 0x80005684), where the warning is gone after the change.
For the Sonic DOL the split output (config.json, splits.txt, symbols.txt) is
byte-identical to v1.8.4's.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
locate_extab_extabindex()probes for_eti_init_infoatsection_end - ETI_INIT_INFO_SIZE * (num_text_sections + 1)and walks forward, reading a candidate table at eachaddress. A section's size can stop short of the next section: sizes come from
_rom_copy_info, whose values arerounded differently from the file's. The first candidate then lands in the gap,
read_eti_init_info()fails(
Failed to locate section @ <addr>), and the?on it abandons the search for the whole program — soextab/extabindexare never named.Consequences:
extabindexsection, the split fails hard instead:Failed to find extab section.Reproduction
dtk dol spliton v1.8.4:WARN Failed to locate extab/etabindex: Failed to locate section @ 0x80173124(this program has no extab, so the warning was all you saw)..initat 0x80003100 with a copied size of 0x2500 (file size0x2520),
extabat 0x80005620,extabindexat 0x80005660,_eti_init_infoat 0x80005684. Number of codesections is 2, so the first probe for the
extabsection is0x80005648 - 48 = 0x80005618, which is in the gapbetween
.init's copied end (0x800055F0/0x80005600) and 0x80005620 →Failed to locate section @ 0x80005618,and the exception tables are never named.
Change
saturating_sub(..).max(section_start)), so a small section can'tunderflow the probe below its own start.
continue) instead of returning an error for the whole program.Verification
build/config.json,config/*/splits.txt,config/*/symbols.txtare byte-identical to v1.8.4 (the patch is inert for programs without exception tables).
Failed to locate section @ 0x80005618warning is gone andextab/extabindexare named, with
@eti_*symbols created the way they are for every other game.