mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 14:46:02 +02:00
* Fetch PECOFF section sizes correctly (not including zero padding), resolves #22788.
git-svn-id: trunk@22879 -
This commit is contained in:
parent
1261d6617d
commit
47cd83ae14
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user