-
Notifications
You must be signed in to change notification settings - Fork 144
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
memory alignment issues #704
Comments
Is the problem that |
@pgoodman Yes, Linux's longdouble = 16 bytes, but linux nan80_t in math.h outputs 10 bytes after attribute((packed)). I tested it on Windows and it outputs 16 bytes. If Windows also outputs 10 bytes, then attribute((packed)) makes sense. |
Does |
@pgoodman If want to align to 10 bytes on windows might want to enable a flag bit like gcc_bitfield in llvm,But this flag bit does not appear to exist at the moment |
@pgoodman You can use a virtual machine to test the exe I compiled to see if there is any problem with the output ir |
There should be a problem with this piece of code. kEightyBitsInBytes should not be equal to 10. Modify this constant to equal 16. Although it is equal to 10 after the compiler is packed on Linux, it is equal to 16 on Windows and remove the attribute of the structure. ((packed)) attribute, so that struct will not have memory alignment operations, union will have memory alignment operations, and both windows and linux will display 16 bytes. On the linux platform, long double occupies 16 bytes, so modify kEightyBitsInBytes=16 is more appropriate, so that we can simulate long double even if Xclang pf80 is enabled on windows. I don't know if my verification is correct, please give your opinion.
There is also a compiled version for Windows, you can test it when you have time.
https://github.com/lifting-bits/remill/files/14559396/remill-lift-17.zip
https://godbolt.org/z/8Tfc7eEhW
The text was updated successfully, but these errors were encountered: