|
@@ -931,8 +931,7 @@ implementation
|
|
|
|
|
|
procedure TInternalLinkerWin.DefaultLinkScript;
|
|
procedure TInternalLinkerWin.DefaultLinkScript;
|
|
var
|
|
var
|
|
- s,s2,
|
|
|
|
- ibase : TCmdStr;
|
|
|
|
|
|
+ s,s2 : TCmdStr;
|
|
secname,
|
|
secname,
|
|
secnames : string;
|
|
secnames : string;
|
|
begin
|
|
begin
|
|
@@ -973,23 +972,20 @@ implementation
|
|
else
|
|
else
|
|
Concat('ENTRYNAME _mainCRTStartup');
|
|
Concat('ENTRYNAME _mainCRTStartup');
|
|
end;
|
|
end;
|
|
- ibase:='';
|
|
|
|
- if assigned(DLLImageBase) then
|
|
|
|
- ibase:=DLLImageBase^
|
|
|
|
- else
|
|
|
|
|
|
+ if not ImageBaseSetExplicity then
|
|
begin
|
|
begin
|
|
if IsSharedLibrary then
|
|
if IsSharedLibrary then
|
|
- ibase:='10000000'
|
|
|
|
|
|
+ imagebase:=$10000000
|
|
else
|
|
else
|
|
if target_info.system in system_wince then
|
|
if target_info.system in system_wince then
|
|
- ibase:='10000'
|
|
|
|
|
|
+ imagebase:=$10000
|
|
else
|
|
else
|
|
if target_info.system=system_x86_64_win64 then
|
|
if target_info.system=system_x86_64_win64 then
|
|
- ibase:='100000000'
|
|
|
|
|
|
+ imagebase:=$100000000
|
|
else
|
|
else
|
|
- ibase:='400000';
|
|
|
|
|
|
+ imagebase:=$400000;
|
|
end;
|
|
end;
|
|
- Concat('IMAGEBASE $' + ibase);
|
|
|
|
|
|
+ Concat('IMAGEBASE $' + hexStr(imagebase, SizeOf(imagebase)*2));
|
|
Concat('HEADER');
|
|
Concat('HEADER');
|
|
Concat('EXESECTION .text');
|
|
Concat('EXESECTION .text');
|
|
Concat(' SYMBOL __text_start__');
|
|
Concat(' SYMBOL __text_start__');
|
|
@@ -1353,8 +1349,8 @@ implementation
|
|
EntryStr:='--entry=_WinMainCRTStartup'
|
|
EntryStr:='--entry=_WinMainCRTStartup'
|
|
else
|
|
else
|
|
EntryStr:='--entry=_mainCRTStartup';
|
|
EntryStr:='--entry=_mainCRTStartup';
|
|
- if assigned(DLLImageBase) then
|
|
|
|
- ImageBaseStr:='--image-base=0x'+DLLImageBase^;
|
|
|
|
|
|
+ if ImageBaseSetExplicity then
|
|
|
|
+ ImageBaseStr:='--image-base=0x'+hexStr(imagebase, SizeOf(imagebase)*2);
|
|
if (cs_link_strip in current_settings.globalswitches) then
|
|
if (cs_link_strip in current_settings.globalswitches) then
|
|
StripStr:='-s';
|
|
StripStr:='-s';
|
|
if (cs_link_map in current_settings.globalswitches) then
|
|
if (cs_link_map in current_settings.globalswitches) then
|
|
@@ -1455,8 +1451,8 @@ implementation
|
|
end
|
|
end
|
|
else
|
|
else
|
|
EntryStr:='--entry _DLLMainCRTStartup';
|
|
EntryStr:='--entry _DLLMainCRTStartup';
|
|
- if assigned(DLLImageBase) then
|
|
|
|
- ImageBaseStr:='--image-base=0x'+DLLImageBase^;
|
|
|
|
|
|
+ if ImageBaseSetExplicity then
|
|
|
|
+ ImageBaseStr:='--image-base=0x'+hexStr(imagebase, SizeOf(imagebase)*2);
|
|
if (cs_link_strip in current_settings.globalswitches) then
|
|
if (cs_link_strip in current_settings.globalswitches) then
|
|
StripStr:='-s';
|
|
StripStr:='-s';
|
|
if (cs_link_map in current_settings.globalswitches) then
|
|
if (cs_link_map in current_settings.globalswitches) then
|