* new tf_smartlink_library flag

* use create_smartlink[_sections|_library] to check what to 
    do for smartlinking

git-svn-id: trunk@8715 -
This commit is contained in:
peter 2007-10-01 16:55:08 +00:00
parent 34e8576452
commit 9f0ca44c94
28 changed files with 87 additions and 69 deletions

View File

@ -130,8 +130,9 @@ interface
function getaltcopy(AList:TFPHashObjectList;altnr: longint): TAsmSymbol; override;
end;
function use_smartlink_section:boolean;
function maybe_smartlink_symbol:boolean;
function create_smartlink_sections:boolean;inline;
function create_smartlink_library:boolean;inline;
function create_smartlink:boolean;inline;
function LengthUleb128(a: qword) : byte;
function LengthSleb128(a: int64) : byte;
@ -146,17 +147,31 @@ implementation
verbose;
function use_smartlink_section:boolean;
function create_smartlink_sections:boolean;inline;
begin
result:=(af_smartlink_sections in target_asm.flags) and
(tf_smartlink_sections in target_info.flags);
end;
function maybe_smartlink_symbol:boolean;
function create_smartlink_library:boolean;inline;
begin
result:=(cs_Create_smart in current_settings.moduleswitches) or
use_smartlink_section;
result:=(cs_Create_smart in current_settings.moduleswitches) and
(tf_smartlink_library in target_info.flags) and
not create_smartlink_sections;
end;
function create_smartlink:boolean;inline;
begin
result:=(
(af_smartlink_sections in target_asm.flags) and
(tf_smartlink_sections in target_info.flags)
) or
(
(cs_Create_smart in current_settings.moduleswitches) and
(tf_smartlink_library in target_info.flags)
);
end;

View File

@ -639,8 +639,7 @@ implementation
procedure maybe_new_object_file(list:TAsmList);
begin
if (cs_create_smart in current_settings.moduleswitches) and
(not use_smartlink_section) then
if create_smartlink_library then
list.concat(tai_cutobject.create);
end;
@ -659,7 +658,7 @@ implementation
list.concat(tai_section.create(Asectype,Aname,Aalign));
list.concat(cai_align.create(Aalign));
if Aglobal or
maybe_smartlink_symbol then
create_smartlink then
list.concat(tai_symbol.createname_global(Aname,Asymtyp,0))
else
list.concat(tai_symbol.createname(Aname,Asymtyp,0));

View File

@ -321,7 +321,7 @@ implementation
it is easier to disable it for smartlinking. It doesn't take up
filespace }
if not(target_info.system in systems_darwin) and
use_smartlink_section and
create_smartlink_sections and
(aname<>'') and
(atype <> sec_toc) and
(atype<>sec_bss) then
@ -1070,7 +1070,7 @@ implementation
AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]);
end;
if (cs_create_smart in current_settings.moduleswitches) and
if create_smartlink_sections and
(target_info.system in systems_darwin) then
AsmWriteLn(#9'.subsections_via_symbols');

View File

@ -1882,7 +1882,7 @@ unit cgcpu;
make_global:=false;
if (not current_module.is_unit) or
(cs_create_smart in current_settings.moduleswitches) or
create_smartlink or
(procdef.owner.defowner.owner.symtabletype=globalsymtable) then
make_global:=true;

View File

@ -478,7 +478,7 @@ interface
AsmLn;
AsmWrite('SECTION ');
AsmWrite(secnames[atype]);
if use_smartlink_section and
if create_smartlink_sections and
(atype<>sec_bss) and
(aname<>'') then
begin

View File

@ -629,8 +629,7 @@ unit cgcpu;
make_global:=false;
if (not current_module.is_unit) or
(cs_create_smart in current_settings.moduleswitches) or
(af_smartlink_sections in target_asm.flags) or
create_smartlink or
(procdef.owner.defowner.owner.symtabletype=globalsymtable) then
make_global:=true;

View File

@ -1551,7 +1551,7 @@ unit cgcpu;
make_global:=false;
if (not current_module.is_unit) or
(cs_create_smart in current_settings.moduleswitches) or
create_smartlink or
(procdef.owner.defowner.owner.symtabletype=globalsymtable) then
make_global:=true;

View File

@ -2172,7 +2172,7 @@ implementation
maybe_new_object_file(list);
new_section(list,sectype,lower(sym.mangledname),varalign);
if (sym.owner.symtabletype=globalsymtable) or
maybe_smartlink_symbol or
create_smartlink or
DLLSource or
(assigned(current_procinfo) and
(po_inline in current_procinfo.procdef.procoptions)) or

View File

@ -949,7 +949,7 @@ const pemagic : array[0..3] of byte = (
secname : string;
begin
secname:=coffsecnames[atype];
if use_smartlink_section and
if create_smartlink_sections and
(aname<>'') then
begin
case aorder of

View File

@ -619,7 +619,7 @@ implementation
result:=secname+'.'+aname;
exit;
end;
if use_smartlink_section and (aname<>'') then
if create_smartlink_sections and (aname<>'') then
begin
case aorder of
secorder_begin :

View File

@ -2453,11 +2453,6 @@ begin
(target_info.system in [system_i386_win32,system_x86_64_win64]) then
exclude(target_info.flags,tf_smartlink_sections);
{$ifdef x86_64}
{$warning HACK: turn off smartlinking}
exclude(init_settings.moduleswitches,cs_create_smart);
{$endif}
if not LinkTypeSetExplicitly then
set_default_link_type;

View File

@ -98,8 +98,7 @@ implementation
GenerateAsm(false);
{ Also create a smartlinked version ? }
if (cs_create_smart in current_settings.moduleswitches) and
(not use_smartlink_section) then
if create_smartlink_library then
begin
GenerateAsm(true);
if (af_needar in target_asm.flags) then
@ -117,8 +116,7 @@ implementation
current_module.linkunitofiles.add(current_module.objfilename^,link_static);
current_module.flags:=current_module.flags or uf_static_linked;
if (cs_create_smart in current_settings.moduleswitches) and
not use_smartlink_section then
if create_smartlink_library then
begin
current_module.linkunitstaticlibs.add(current_module.staticlibfilename^,link_smart);
current_module.flags:=current_module.flags or uf_smart_linked;
@ -129,8 +127,7 @@ implementation
procedure create_dwarf;
begin
{ Dwarf conflicts with smartlinking in separate .a files }
if (cs_create_smart in current_settings.moduleswitches) and
not use_smartlink_section then
if create_smartlink_library then
exit;
{ Call frame information }
if (tf_needs_dwarf_cfi in target_info.flags) and

View File

@ -138,7 +138,7 @@ implementation
However, we do not do this for smart linked files since that would cause a lot of (mostly useless)
overhead. In theory, we could also not do it if "-a" is not used. The Mac OS X assembler (which is
based on GNU as) "natively" supports full register names.}
if (cs_create_smart in current_settings.moduleswitches) and
if create_smartlink_library and
(target_info.system <> system_powerpc_darwin) then
result:=gas_regname_short_table[p]
else

View File

@ -147,8 +147,8 @@ var
begin
p := findreg_by_number(r);
if p <> 0 then
if (cs_create_smart in current_settings.moduleswitches) and
not(target_info.system = system_powerpc64_darwin) then
if create_smartlink_library and
not(target_info.system = system_powerpc64_darwin) then
result := gas_regname_short_table[p]
else
result := gas_regname_table[p]

View File

@ -85,7 +85,7 @@ unit cgppc;
const
TOpCmp2AsmCond: Array[topcmp] of TAsmCondFlag = (C_NONE,C_EQ,C_GT,
C_LT,C_GE,C_LE,C_NE,C_LE,C_LT,C_GE,C_GT);
C_LT,C_GE,C_LE,C_NE,C_LE,C_LT,C_GE,C_GT);
implementation
@ -106,7 +106,7 @@ unit cgppc;
begin
result:=
((pi_do_call in current_procinfo.flags) or
([cs_lineinfo,cs_debuginfo,cs_profile] * current_settings.moduleswitches <> []));
([cs_lineinfo,cs_debuginfo,cs_profile] * current_settings.moduleswitches <> []));
end;
@ -370,7 +370,7 @@ unit cgppc;
procedure tcgppcgen.a_load_reg_ref(list: TAsmList; fromsize, tosize: TCGSize;
reg: tregister; const ref: treference);
const
StoreInstr: array[OS_8..OS_INT, boolean, boolean] of TAsmOp =
{ indexed? updating?}
@ -390,7 +390,7 @@ unit cgppc;
internalerror(2002090903);
if not (tosize in [OS_8..OS_INT,OS_S8..OS_SINT]) then
internalerror(2002090905);
ref2 := ref;
fixref(list, ref2);
if tosize in [OS_S8..OS_SINT] then
@ -507,12 +507,12 @@ unit cgppc;
{ subsetregs always count bits from right to left }
fromsreg.startbit := loadbitsize-restbits;
fromsreg.bitlen := restbits;
tosreg.subsetreg := valuereg;
tosreg.subsetregsize := OS_INT;
tosreg.startbit := 0;
tosreg.bitlen := restbits;
a_load_subsetreg_subsetreg(list,subsetsize,subsetsize,fromsreg,tosreg);
end;
@ -653,7 +653,7 @@ unit cgppc;
make_global:=false;
if (not current_module.is_unit) or
(cs_create_smart in current_settings.moduleswitches) or
create_smartlink or
(procdef.owner.defowner.owner.symtabletype=globalsymtable) then
make_global:=true;

View File

@ -1535,7 +1535,7 @@ implementation
if (not current_module.in_interface) then
include(pdflags,pd_implemen);
if (not current_module.is_unit) or
maybe_smartlink_symbol or
create_smartlink or
{
taking addresses of static procedures goes wrong
if they aren't global when pic is used (FK)

View File

@ -1373,7 +1373,7 @@ implementation
{ have been modified by the directives parsed above }
new_section(list,cursectype,lower(sym.mangledname),const_align(sym.vardef.alignment));
if (sym.owner.symtabletype=globalsymtable) or
maybe_smartlink_symbol or
create_smartlink or
(assigned(current_procinfo) and
(po_inline in current_procinfo.procdef.procoptions)) or
DLLSource then

View File

@ -295,6 +295,7 @@ interface
tf_static_reg_based,
tf_needs_symbol_size,
tf_smartlink_sections,
tf_smartlink_library,
tf_needs_dwarf_cfi,
tf_use_8_3,
tf_pic_uses_got,

View File

@ -32,7 +32,8 @@ unit i_beos;
system : system_i386_BeOS;
name : 'Beos for i386';
shortname : 'Beos';
flags : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses,
tf_smartlink_library];
cpu : cpu_i386;
unit_env : 'BEOSUNITS';
extradefines : 'UNIX;HASUNIX';
@ -83,6 +84,7 @@ unit i_beos;
);
first_parm_offset : 8;
stacksize : 8192;
abi : abi_default
);
implementation

View File

@ -39,7 +39,7 @@ unit i_bsd;
{$ifdef segment_threadvars}
tf_section_threadvars,
{$endif segment_threadvars}
tf_needs_symbol_type,tf_needs_symbol_size {,tf_smartlink_sections}];
tf_needs_symbol_type,tf_needs_symbol_size,tf_smartlink_library {,tf_smartlink_sections}];
cpu : cpu_i386;
unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX';
@ -100,7 +100,7 @@ unit i_bsd;
name : 'FreeBSD for x86-64';
shortname : 'FreeBSD';
flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi,{Linux: tf_library_needs_pic,}tf_needs_symbol_type,
tf_files_case_sensitive,tf_use_function_relative_addresses
tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library
{ tf_pic_uses_got,tf_smartlink_sections}];
cpu : cpu_x86_64;
unit_env : 'BSDUNITS';
@ -161,7 +161,7 @@ unit i_bsd;
system : system_i386_NetBSD;
name : 'NetBSD for i386';
shortname : 'NetBSD';
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_under_development,tf_files_case_sensitive,tf_smartlink_library,tf_use_function_relative_addresses];
cpu : cpu_i386;
unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX';
@ -220,7 +220,7 @@ unit i_bsd;
system : system_i386_OpenBSD;
name : 'OpenBSD for i386';
shortname : 'OpenBSD';
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_i386;
unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX';
@ -279,7 +279,7 @@ unit i_bsd;
system : system_m68k_NetBSD;
name : 'NetBSD for m68k';
shortname : 'NetBSD';
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_m68k;
unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX';
@ -338,7 +338,7 @@ unit i_bsd;
system : system_powerpc_netbsd;
name : 'NetBSD for PowerPC';
shortname : 'NetBSD';
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_powerpc;
unit_env : '';
extradefines : 'UNIX;BSD;HASUNIX';

View File

@ -35,6 +35,7 @@ unit i_linux;
{ cross compiled windres can be used to compile .rc files on linux }
rcbin : 'windres';
rccmd : '--include $INC -O res -o $RES $RC';
resourcefileclass : nil;
);
res_elf64_info : tresinfo =
@ -45,6 +46,7 @@ unit i_linux;
{ cross compiled windres can be used to compile .rc files on linux }
rcbin : 'windres';
rccmd : '--include $INC -O res -o $RES $RC';
resourcefileclass : nil;
);
system_i386_linux_info : tsysteminfo =
@ -57,7 +59,7 @@ unit i_linux;
tf_section_threadvars,
{$endif segment_threadvars}
tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
tf_needs_dwarf_cfi];
tf_smartlink_library,tf_needs_dwarf_cfi];
cpu : cpu_i386;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';
@ -116,7 +118,7 @@ unit i_linux;
system : system_x86_6432_LINUX;
name : 'Linux for x64_6432';
shortname : 'Linux6432';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_pic_uses_got{,tf_smartlink_sections}];
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_pic_uses_got{,tf_smartlink_sections},tf_smartlink_library];
cpu : cpu_x86_64;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';
@ -175,7 +177,8 @@ unit i_linux;
system : system_m68k_linux;
name : 'Linux for m68k';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
tf_smartlink_library];
cpu : cpu_m68k;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';
@ -234,7 +237,8 @@ unit i_linux;
system : system_powerpc_LINUX;
name : 'Linux for PowerPC';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
tf_smartlink_library];
cpu : cpu_powerpc;
unit_env : '';
extradefines : 'UNIX;HASUNIX';
@ -293,7 +297,8 @@ unit i_linux;
system : system_powerpc64_LINUX;
name : 'Linux for PowerPC64';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
tf_requires_proper_alignment,tf_smartlink_library];
cpu : cpu_powerpc64;
unit_env : '';
extradefines : 'UNIX;HASUNIX';
@ -352,7 +357,8 @@ unit i_linux;
system : system_alpha_LINUX;
name : 'Linux for Alpha';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_alpha;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';
@ -411,7 +417,7 @@ unit i_linux;
system : system_x86_64_LINUX;
name : 'Linux for x86-64';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi,
flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_smartlink_library,
tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
cpu : cpu_x86_64;
unit_env : 'LINUXUNITS';
@ -471,7 +477,8 @@ unit i_linux;
system : system_SPARC_Linux;
name : 'Linux for SPARC';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
flags : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_smartlink_library,
tf_use_function_relative_addresses,tf_requires_proper_alignment];
cpu : cpu_SPARC;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';
@ -531,7 +538,7 @@ unit i_linux;
name : 'Linux for ARM';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections];
tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections,tf_smartlink_library];
cpu : cpu_arm;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';

View File

@ -32,7 +32,7 @@ unit i_nwl;
system : system_i386_netwlibc;
name : 'Netware for i386(libc)';
shortname : 'Netwlibc';
flags : [tf_use_function_relative_addresses];
flags : [tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_i386;
unit_env : 'NETWLIBCUNITS';
extradefines : 'NETWARE;NETWARE_LIBC';
@ -83,6 +83,7 @@ unit i_nwl;
);
first_parm_offset : 8;
stacksize : 16384;
abi : abi_default
);
implementation

View File

@ -32,7 +32,7 @@ unit i_nwm;
system : system_i386_netware;
name : 'Netware for i386(clib)';
shortname : 'Netware';
flags : [tf_use_function_relative_addresses];
flags : [tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_i386;
unit_env : 'NETWAREUNITS';
extradefines : 'NETWARE_CLIB';
@ -83,6 +83,7 @@ unit i_nwm;
);
first_parm_offset : 8;
stacksize : 16384;
abi : abi_default
);
implementation

View File

@ -32,7 +32,7 @@ unit i_sunos;
system : system_i386_solaris;
name : 'Solaris for i386';
shortname : 'solaris';
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
cpu : cpu_i386;
unit_env : 'SOLARISUNITS';
extradefines : 'UNIX;LIBC;SUNOS;HASUNIX';
@ -91,7 +91,8 @@ unit i_sunos;
system : system_sparc_solaris;
name : 'Solaris for SPARC';
shortname : 'solaris';
flags : [tf_needs_symbol_size,tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
flags : [tf_needs_symbol_size,tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,
tf_requires_proper_alignment,tf_smartlink_library];
cpu : cpu_SPARC;
unit_env : 'SOLARISUNITS';
extradefines : 'UNIX;LIBC;SUNOS;HASUNIX';

View File

@ -34,7 +34,7 @@ unit i_symbian;
name : 'Symbian OS for i386';
shortname : 'Symbian';
flags : [tf_files_case_aware, tf_has_dllscanner,
tf_use_function_relative_addresses];
tf_smartlink_library,tf_use_function_relative_addresses];
cpu : cpu_i386;
unit_env : 'SYMBIANUNITS';
extradefines : 'SYMBIAN';

View File

@ -32,7 +32,7 @@ unit i_win;
system : system_i386_WIN32;
name : 'Win32 for i386';
shortname : 'Win32';
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,tf_smartlink_library
,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},tf_winlikewidestring,tf_no_pic_supported];
cpu : cpu_i386;
unit_env : 'WIN32UNITS';
@ -93,7 +93,7 @@ unit i_win;
name : 'Win64 for x64';
shortname : 'Win64';
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,
tf_winlikewidestring,tf_no_pic_supported];
tf_smartlink_sections,tf_smartlink_library,tf_winlikewidestring,tf_no_pic_supported];
cpu : cpu_x86_64;
unit_env : 'WIN64UNITS';
extradefines : 'MSWINDOWS;WINDOWS';

View File

@ -296,7 +296,7 @@ begin
DynamicLinker:='/lib/ld-linux.so.2';
libctype:=glibc21;
end
else
else
{$endif i386}
if fileexists(sysrootpath+'/lib/ld-uClibc.so.0',false) then
begin
@ -812,7 +812,7 @@ begin
StripStr:='-s';
if (cs_link_map in current_settings.globalswitches) then
StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
if use_smartlink_section then
if create_smartlink_sections then
GCSectionsStr:='--gc-sections';
If (cs_profile in current_settings.moduleswitches) or
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then

View File

@ -1326,7 +1326,7 @@ implementation
AsBinStr:=FindUtil(utilsprefix+'as');
if RelocSection then
RelocStr:='--base-file base.$$$';
if use_smartlink_section then
if create_smartlink_sections then
GCSectionsStr:='--gc-sections';
if target_info.system in [system_arm_wince,system_i386_wince] then
AppTypeStr:='--subsystem wince'
@ -1432,7 +1432,7 @@ implementation
AsBinStr:=FindUtil(utilsprefix+'as');
if RelocSection then
RelocStr:='--base-file base.$$$';
if use_smartlink_section then
if create_smartlink_sections then
GCSectionsStr:='--gc-sections';
if apptype=app_gui then
begin