mirror of
https://github.com/encounter/decomp-toolkit.git
synced 2025-12-12 06:45:09 +00:00
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:
@@ -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])?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user