* when reading ImpDef records, add '.dll' to the libname if it has no extension,

in order to be consistent with externals, declared in pascal files. The '.dll'
  extension will be stripped later, when generating the NewExe file.

git-svn-id: trunk@42615 -
This commit is contained in:
nickysn 2019-08-09 14:27:11 +00:00
parent dd9c76eeec
commit 1f2354752c

View File

@ -615,6 +615,7 @@ interface
end;
function StripDllExt(const DllName:TSymStr):TSymStr;
function MaybeAddDllExt(const DllName:TSymStr):TSymStr;
implementation
@ -2028,9 +2029,9 @@ implementation
if not CaseSensitiveSymbols then
SymName:=UpCase(SymName);
if ImpDefRec.ImportByOrdinal then
TOmfObjData(objdata).AddImportSymbol(ImpDefRec.ModuleName,'',SymName,ImpDefRec.Ordinal,false)
TOmfObjData(objdata).AddImportSymbol(MaybeAddDllExt(ImpDefRec.ModuleName),'',SymName,ImpDefRec.Ordinal,false)
else
TOmfObjData(objdata).AddImportSymbol(ImpDefRec.ModuleName,ImpDefRec.Name,SymName,0,false);
TOmfObjData(objdata).AddImportSymbol(MaybeAddDllExt(ImpDefRec.ModuleName),ImpDefRec.Name,SymName,0,false);
Result:=True;
ImpDefRec.Free;
end;
@ -4215,6 +4216,14 @@ cleanup:
Result:=DllName;
end;
function MaybeAddDllExt(const DllName: TSymStr): TSymStr;
begin
if ExtractFileExt(DllName)='' then
Result:=ChangeFileExt(DllName,'.dll')
else
Result:=DllName;
end;
{*****************************************************************************
Initialize
*****************************************************************************}