* Fetch PECOFF section sizes correctly (not including zero padding), resolves #22788.

git-svn-id: trunk@22879 -
This commit is contained in:
sergei 2012-10-30 09:00:13 +00:00
parent 1261d6617d
commit 47cd83ae14

View File

@ -379,7 +379,17 @@ begin
if asecname=secname then
begin
secofs:=cardinal(sechdr.datapos) + E.ImgOffset;
{$ifdef GO32V2}
seclen:=sechdr.datalen;
{$else GO32V2}
{ In PECOFF, datalen includes file padding up to the next section.
vsize is the actual payload size if it does not exceed datalen,
otherwise it is .bss (or alike) section that we should ignore. }
if sechdr.vsize<=sechdr.datalen then
seclen:=sechdr.vsize
else
exit;
{$endif GO32V2}
FindSectionCoff:=true;
exit;
end;