Skip to content

lcf: Fix incorrect section end alignment for .ctor#55

Merged
AetiasHax merged 1 commit into
mainfrom
lcf-ctor-end-alignment
Mar 28, 2026
Merged

lcf: Fix incorrect section end alignment for .ctor#55
AetiasHax merged 1 commit into
mainfrom
lcf-ctor-end-alignment

Conversation

@AetiasHax
Copy link
Copy Markdown
Owner

#53 added WRITEW(0); at the end of each .ctor section in the LCF. This had a chance to cause the section end address alignment calculation to be incorrect. Namely, if .ctor just happens to end on a 32-byte boundary, the alignment would be set to 32, when in reality the WRITEW(0); makes the .ctor section end 4 bytes later. In such cases, the alignment should have been 4.

The fix is simple, just add 4 to the end address when writing LCF code for .ctor sections.

@AetiasHax AetiasHax merged commit f98ef25 into main Mar 28, 2026
7 checks passed
@AetiasHax AetiasHax deleted the lcf-ctor-end-alignment branch March 28, 2026 12: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