add comment

This commit is contained in:
Folkert 2022-09-21 12:37:48 +02:00
parent 8f5b005f10
commit 2d2fbfd987
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -1128,6 +1128,7 @@ mod test {
.map(|s| s.file_range.end - s.file_range.start)
.sum();
// offset_in_section now becomes a proper virtual address
for symbol in symbols.iter_mut() {
if symbol.section_kind == kind {
symbol.offset_in_section += image_base as usize + virtual_address as usize;
@ -1137,8 +1138,6 @@ mod test {
let virtual_size = length as u32;
let size_of_raw_data = next_multiple_of(length, file_alignment) as u32;
file_bytes_added += next_multiple_of(length, section_alignment) as u32;
match kind {
SectionKind::Text => {
code_bytes_added += size_of_raw_data;
@ -1181,6 +1180,7 @@ mod test {
section_header_start += std::mem::size_of::<ImageSectionHeader>();
section_file_offset += size_of_raw_data as usize;
virtual_address += next_multiple_of(length, section_alignment) as u32;
file_bytes_added += next_multiple_of(length, section_alignment) as u32;
}
update_optional_header(