Skip to content

Commit

Permalink
write/xcoff: fix section address for XCOFF32
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc committed Apr 3, 2023
1 parent d57edca commit 23428db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/write/xcoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ impl<'a> Object<'a> {
} else {
let section_header = xcoff::SectionHeader32 {
s_name: sectname,
s_paddr: U32::new(BE, 0),
s_vaddr: U32::new(BE, 0),
s_paddr: U32::new(BE, section_offsets[index].address as u32),
// This field has the same value as the s_paddr field.
s_vaddr: U32::new(BE, section_offsets[index].address as u32),
s_size: U32::new(BE, section.data.len() as u32),
s_scnptr: U32::new(BE, section_offsets[index].data_offset as u32),
s_relptr: U32::new(BE, section_offsets[index].reloc_offset as u32),
Expand Down

0 comments on commit 23428db

Please sign in to comment.