mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
elf: fix a section alignment edge case
This commit is contained in:
parent
ceeb2d94cd
commit
199ab0a73c
1 changed files with 6 additions and 2 deletions
|
|
@ -372,6 +372,7 @@ pub fn process_minielf(b: &[u8]) -> Result<MiniElf, ElfReadError> {
|
|||
if s.get_type() != Ok(ShType::NoBits) {
|
||||
let section_data = s.raw_data(&elf);
|
||||
let pad_amount = if let Some(next_section) = section_iter.peek() {
|
||||
if next_section.get_type() != Ok(ShType::NoBits) {
|
||||
if section_data.len() % next_section.align() as usize != 0 {
|
||||
next_section.align() as usize - (section_data.len() % next_section.align() as usize)
|
||||
} else {
|
||||
|
|
@ -379,6 +380,9 @@ pub fn process_minielf(b: &[u8]) -> Result<MiniElf, ElfReadError> {
|
|||
}
|
||||
} else {
|
||||
0
|
||||
}
|
||||
} else {
|
||||
0
|
||||
};
|
||||
|
||||
debug!(
|
||||
|
|
|
|||
Loading…
Reference in a new issue