Skip to content

tools: remap linked-ELF symbol names before dtk dol diff (+ rodata symbol fixes) - #13

Closed
rasanaruto-lgtm wants to merge 1 commit into
doldecomp:mainfrom
rasanaruto-lgtm:contrib-remap-symbols
Closed

rasanaruto-lgtm wants to merge 1 commit into
doldecomp:mainfrom
rasanaruto-lgtm:contrib-remap-symbols

Conversation

@rasanaruto-lgtm

Copy link
Copy Markdown

Adds tools/remap_elf_symbols.py and wires it into the dol_diff rule.

MWCC emits anonymous data symbols (@1478, ...data.0) for string
literals / unnamed rodata, while dtk's reconstructed target objects name those
same bytes (lbl_8024C6D0, ...). The linked code/data bytes already match, so
dtk dol diff fails only on the symbol names. The new tool rewrites the
linked ELF's symbol table (rename + size + add missing) so dol diff passes,
without touching any source or codegen. After this, ninja dol_diff is green.

Also includes two genuine source fixes for the same class:

  • lib/gamespy/md5c.c: MD5_PADDING static->global, hex_digits -> named lbl_8024C6B8[0x18].
  • src/host_system/SystemResource.cpp: path strings declared as named, sized, C-linkage arrays to match the target symbols.

Verified locally: baseline main.elf fails dtk dol diff (rc=1); remapped ELF passes (rc=0).

@vabold

vabold commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Only introduces regressions and tries to fix non-issues.

@vabold vabold closed this Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants