Fix v1-2 REL alignment regression
Alignment after section data and before relocations / import table is exclusive to REL v3.
This commit is contained in:
parent
c403931f0f
commit
9dfdbb9301
|
@ -367,7 +367,7 @@ checksum = "c2e06f9bce634a3c898eb1e5cb949ff63133cbb218af93cc9b38b31d6f3ea285"
|
|||
|
||||
[[package]]
|
||||
name = "decomp-toolkit"
|
||||
version = "0.9.5"
|
||||
version = "0.9.6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"ar",
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "decomp-toolkit"
|
|||
description = "Yet another GameCube/Wii decompilation toolkit."
|
||||
authors = ["Luke Street <luke@street.dev>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
version = "0.9.5"
|
||||
version = "0.9.6"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
repository = "https://github.com/encounter/decomp-toolkit"
|
||||
|
|
|
@ -853,8 +853,10 @@ where
|
|||
offset = (offset + align) & !align;
|
||||
offset += section.size() as u32;
|
||||
}
|
||||
// Align to 4 after section data
|
||||
offset = (offset + 3) & !3;
|
||||
if info.version >= 3 {
|
||||
// Align to 4 after section data
|
||||
offset = (offset + 3) & !3;
|
||||
}
|
||||
|
||||
fn do_relocation_layout(
|
||||
relocations: &[RelReloc],
|
||||
|
@ -1047,8 +1049,8 @@ where
|
|||
}
|
||||
w.write_all(§ion_data)?;
|
||||
}
|
||||
// Align to 4 after section data
|
||||
{
|
||||
if info.version >= 3 {
|
||||
// Align to 4 after section data
|
||||
let position = w.stream_position()?;
|
||||
w.write_all(&vec![0u8; calculate_padding(position, 4) as usize])?;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue