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.
This commit is contained in:
Nick Clifton
2019-12-05 13:56:07 +00:00
parent 2410edcd31
commit a23e9ba17f
2 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2019-12-05 Nick Clifton <nickc@redhat.com>
PR 25029
* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Ignore empty sections
when computing the sizes stored in the headers.
2019-12-03 Alan Modra <amodra@gmail.com>
PR 25230

View File

@@ -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)