diff options
author | Nick Clifton <nickc@redhat.com> | 2019-12-05 13:56:07 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-12-05 13:56:07 +0000 |
commit | a23e9ba17f6ab8bef1f2cc02686e8567bdc728ca (patch) | |
tree | f2084fa1090bf357863a285478b1d0fd25771ad4 /bfd/peXXigen.c | |
parent | 2410edcd3176d81d0ab8d24afe69f0d59649f69e (diff) | |
download | fsf-binutils-gdb-a23e9ba17f6ab8bef1f2cc02686e8567bdc728ca.zip fsf-binutils-gdb-a23e9ba17f6ab8bef1f2cc02686e8567bdc728ca.tar.gz fsf-binutils-gdb-a23e9ba17f6ab8bef1f2cc02686e8567bdc728ca.tar.bz2 |
Fix a problem computing the size fields in the PE format header.
PR 25029
* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Ignore empty sections
when computing the sizes stored in the headers.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r-- | bfd/peXXigen.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 1f55f92..71d47ae 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -723,6 +723,9 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) { int rounded = FA (sec->size); + if (rounded == 0) + continue; + /* The first non-zero section filepos is the header size. Sections without contents will have a filepos of 0. */ if (hsize == 0) |