aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-09-06 08:34:24 +0200
committerJan Beulich <jbeulich@suse.com>2024-09-06 08:34:24 +0200
commita844415db8784bf92c0adc7163dc9b5c552a84e1 (patch)
tree1f2feee4710e6b8b78ec3f407df6eb4f6feef0a7
parentf12eb19e1794fe7e7a7414f628a17991b4bc4f61 (diff)
downloadfsf-binutils-gdb-a844415db8784bf92c0adc7163dc9b5c552a84e1.zip
fsf-binutils-gdb-a844415db8784bf92c0adc7163dc9b5c552a84e1.tar.gz
fsf-binutils-gdb-a844415db8784bf92c0adc7163dc9b5c552a84e1.tar.bz2
bfd/PE: correct SizeOfImage calculation
We don't really want to align the last section's size to object alignment (when that section may itself not be aligned as much), we want image size to be a multiple thereof.
-rw-r--r--bfd/peXXigen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 51b567e..c09d16e 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -699,8 +699,8 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out)
for the image size. */
if (coff_section_data (abfd, sec) != NULL
&& pei_section_data (abfd, sec) != NULL)
- isize = (sec->vma - extra->ImageBase
- + SA (FA (pei_section_data (abfd, sec)->virt_size)));
+ isize = SA (sec->vma - extra->ImageBase
+ + FA (pei_section_data (abfd, sec)->virt_size));
}
aouthdr_in->dsize = dsize;