New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amd64: align data section to word boundary #8751
Conversation
For the record, something I do not understand is why we never come across this problem when compiling with |
I think (I can't find it properly stated anywhere) that MASM automatically aligns DATA segments to PARAGRAPH (so ALIGN 16) which means you wouldn't see the effect? |
Spot on! https://docs.microsoft.com/en-us/cpp/assembler/masm/segment?view=vs-2019 says that If you agree, do you care approving the PR? I'll add a Changes entry. |
Just to confirm - spotted on mingw64, but your larger fail case didn’t apply on msvc64, but did apply on amd64 on another arch? |
No, just |
It just seems the right thing to do to emit the alignment for all |
1c85b7e
to
4fca5e0
Compare
I rewrote the Changes entry to be more accurate. |
Thanks! |
amd64: align data section to word boundary (cherry-picked from 40cda4a)
4.09 aa70fea |
Should this go to 4.08 ? |
I see no harm in cherry-picking to 4.08. We don't currently have a bugfix-release planned, but you can never know, and some people may in the future want to use the head of the branch anyway. |
amd64: align data section to word boundary (cherry-picked from 40cda4a)
OK, thanks! I added a new heading for a hypothetical |
For 4.06 (for example) we used:
which I think is slightly better unless a release is actually planned. |
Thanks, I fixed it as suggested. |
We came across a case where compiling with
mingw64
results in misaligned statically allocated constants in the data section. This patch fixes the issue. Incidentally, botharm64
(here) andpower
(here) explicitly align the data items to a word boundary.Unfortunately, I haven't been able to come up with a small reproduction case.