Skip to content

Append zero to .ctor section#53

Merged
AetiasHax merged 8 commits into
mainfrom
ctor-write-zero
Mar 17, 2026
Merged

Append zero to .ctor section#53
AetiasHax merged 8 commits into
mainfrom
ctor-write-zero

Conversation

@AetiasHax
Copy link
Copy Markdown
Owner

The final four bytes of .ctor is always zero and is generated by the linker, so there is no reason for those four bytes to be included in delinks.txt.

Since the .ctor section is now shorter, some false positive symbols and relocations pointing to that zero value will no longer be detected by dsd init. However, there is one relocation to the ARM9 program's .ctor section that needs to be preserved, so a new link-time constant was added and the data/relocation analyzer accepts a relocation_overrides where this special relocation can be registered.

Before merging, I will implement a fix command to automatically truncate .ctor sections for already established dsd projects.

@AetiasHax AetiasHax marked this pull request as ready for review March 17, 2026 19:23
@AetiasHax AetiasHax merged commit b53278d into main Mar 17, 2026
7 checks passed
@AetiasHax AetiasHax deleted the ctor-write-zero branch March 17, 2026 19:27
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