mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 20:29:24 +02:00
* Do not write COFF string table into EXE if COFF symbol table is not present. It fixes loading of stripped DLL on Win9x. Bug #12629.
git-svn-id: trunk@12352 -
This commit is contained in:
parent
aa21ff308e
commit
9cc15bd994
@ -2170,9 +2170,11 @@ const pemagic : array[0..3] of byte = (
|
||||
fillchar(header,sizeof(header),0);
|
||||
header.mach:=COFF_MAGIC;
|
||||
header.nsects:=nsects;
|
||||
header.sympos:=sympos;
|
||||
if hassymbols then
|
||||
header.syms:=nsyms;
|
||||
begin
|
||||
header.sympos:=sympos;
|
||||
header.syms:=nsyms;
|
||||
end;
|
||||
if win32 then
|
||||
header.opthdr:=sizeof(tcoffpeoptheader)
|
||||
else
|
||||
@ -2280,15 +2282,17 @@ const pemagic : array[0..3] of byte = (
|
||||
ExeSectionList.ForEachCall(@ExeSectionList_write_header,nil);
|
||||
{ Section data }
|
||||
ExeSectionList.ForEachCall(@ExeSectionList_write_data,nil);
|
||||
{ Optional Symbols }
|
||||
if SymPos<>FWriter.Size then
|
||||
internalerror(200602252);
|
||||
if hassymbols then
|
||||
ExeSymbolList.ForEachCall(@globalsyms_write_symbol,nil);
|
||||
{ Strings }
|
||||
i:=FCoffStrs.size+4;
|
||||
FWriter.write(i,4);
|
||||
FWriter.writearray(FCoffStrs);
|
||||
begin
|
||||
{ Optional Symbols }
|
||||
if SymPos<>FWriter.Size then
|
||||
internalerror(200602252);
|
||||
ExeSymbolList.ForEachCall(@globalsyms_write_symbol,nil);
|
||||
{ Strings }
|
||||
i:=FCoffStrs.size+4;
|
||||
FWriter.write(i,4);
|
||||
FWriter.writearray(FCoffStrs);
|
||||
end;
|
||||
{ Release }
|
||||
FCoffStrs.Free;
|
||||
FCoffSyms.Free;
|
||||
|
Loading…
Reference in New Issue
Block a user