-
Notifications
You must be signed in to change notification settings - Fork 159
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
Decide how to handle incorrect alignment #230
Comments
For prior art, |
I believe that |
While files may come from external sources, they are still generally well formed for the architecture they are intended for. After all, I expect nearly all C code expects the alignment to be correct and reads the headers by directly casting from bytes, and bugs like the one in the PS4 toolchain only go unnoticed because it's for an architecture without alignment constraints. So I think there are three cases:
If we used the feature flag approach, then it would need to be enabled for uses in cases 2 and 3. |
See gimli-rs/addr2line#170 for an example of an ELF file with incorrect section header alignment.
We've got a few options for how to handle this:
SectionHeader64
to only use types that require 4-byte alignment.U32
andU32Bytes
have the same API, and makingU32
an alias ofU32Bytes
when this feature is enabled. I think the only downside is that this prevents supporting both cases in the same application.The text was updated successfully, but these errors were encountered: