-
Notifications
You must be signed in to change notification settings - Fork 173
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
Feature - Strict ELF parser #624
base: main
Are you sure you want to change the base?
Conversation
095fff9
to
d5a97fc
Compare
} else { | ||
aligned = AlignedMemory::<{ HOST_ALIGN }>::from_slice(bytes); | ||
aligned.as_slice() | ||
match e_flags { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mapping will be updated in #602.
893f914
to
e1fd3c8
Compare
e1fd3c8
to
364c6ec
Compare
let aligned; | ||
let bytes = if is_memory_aligned(bytes.as_ptr() as usize, HOST_ALIGN) { | ||
bytes | ||
let e_flags = LittleEndian::read_u32(bytes.get(48..52).ok_or(ElfParserError::OutOfBounds)?); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have a comment explaining these hardcoded numbers (48..52
).
types::{Elf64Ehdr, Elf64Shdr, Elf64Sym}, | ||
}; | ||
|
||
let aligned_memory = AlignedMemory::<{ HOST_ALIGN }>::from_slice(bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still copying the ELF, ins't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, one is still required because of loader-v3 misalignment.
Alternative implementation of #605 for SIMD-0189