Skip to content

Fix overlay table indices after section sort#151

Open
fliperama86 wants to merge 1 commit into
N64Recomp:mainfrom
fliperama86:codex/overlay-table-index-remap
Open

Fix overlay table indices after section sort#151
fliperama86 wants to merge 1 commit into
N64Recomp:mainfrom
fliperama86:codex/overlay-table-index-remap

Conversation

@fliperama86

Copy link
Copy Markdown

Summary

Fix overlay table entries after executable sections are sorted by ROM address.

The table stores original SectionTableEntry::index values, but init_overlays() sorts code_sections in place. After sorting, those values no longer necessarily match positions in code_sections, so overlay lookups can resolve the wrong section.

This builds an original-index to sorted-index map and remaps the overlay table after sorting.

Checks

  • git diff --check
  • cmake -S /tmp/n64modernruntime-overlay-pr -B /tmp/n64modernruntime-overlay-pr-build
  • cmake --build /tmp/n64modernruntime-overlay-pr-build -j$(sysctl -n hw.ncpu)

@fliperama86 fliperama86 marked this pull request as ready for review June 21, 2026 00:44
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.

1 participant