tools: elf: add comment and dead code for alignment fixing

This issue was spotted when the kernel address was wrong.  This fixed
the test, but was indicative of something else being wrong.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-03-10 14:43:15 +08:00
parent edf723e107
commit 4645816674

View file

@ -176,6 +176,10 @@ pub fn read_program<P: AsRef<Path>>(filename: P) -> Result<ProgramDescription, E
debug!(" size: {:?}", s.size());
debug!(" link: {:?}", s.link());
size += s.size();
// // Pad the section so it's a multiple of 4 bytes.
// // It's unclear if this is necessary, since this seems to indicate
// // that something has gone horribly wrong.
// size += (4 - (size & 3)) & 3;
if size & 3 != 0 {
return Err(ElfReadError::SectionNotAligned(name.to_owned(), s.size() as usize));
}