Skip to content

Store alignment of .tdata as read-only variable#6

Merged
fincs merged 2 commits intodevkitPro:masterfrom
ian-h-chamberlain:feature/align-tdata
Sep 14, 2022
Merged

Store alignment of .tdata as read-only variable#6
fincs merged 2 commits intodevkitPro:masterfrom
ian-h-chamberlain:feature/align-tdata

Conversation

@ian-h-chamberlain
Copy link
Contributor

Also ensure __tls_start alignment matches that of .tdata, and use a
minimum align of 8 for the 8-byte ARM TLS header.

This is part of the solution to devkitPro/libctru#497 and an accompanying PR will be opened there.

Also ensure __tls_start alignment matches that of .tdata, and use a
minimum align of 8 for the 8-byte ARM TLS header.
@fincs
Copy link
Member

fincs commented Aug 18, 2022

The main requested changes are in the corresponding libctru PR. As a minor nitpick, the tdata section doesn't really need 8-byte alignment as an enforced baseline. Like I explained in the corresponding PR, this 8-byte alignment is only required by the stack bottom and stack top addresses. It should be possible to adjust the logic in the other PR to make this guarantee without necessarily making it cascade into the tdata section's alignment.

Set __tls_start such that (__tls_start - 8) is has the same alignment as
.tdata.
@fincs fincs merged commit 0202999 into devkitPro:master Sep 14, 2022
@ian-h-chamberlain ian-h-chamberlain deleted the feature/align-tdata branch November 18, 2022 14:13
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