* gc-sections added when section smartlinking is used

This commit is contained in:
peter 2004-10-24 13:36:26 +00:00
parent 3eebc18aab
commit d24241b008
2 changed files with 28 additions and 10 deletions

View File

@ -33,7 +33,7 @@ unit i_linux;
system : system_i386_LINUX; system : system_i386_LINUX;
name : 'Linux for i386'; name : 'Linux for i386';
shortname : 'Linux'; shortname : 'Linux';
flags : [tf_needs_symbol_size]; flags : [tf_needs_symbol_size{,tf_smartlink_sections}];
cpu : cpu_i386; cpu : cpu_i386;
unit_env : 'LINUXUNITS'; unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX'; extradefines : 'UNIX;HASUNIX';
@ -88,7 +88,8 @@ unit i_linux;
heapsize : 256*1024; heapsize : 256*1024;
stacksize : 262144; stacksize : 262144;
DllScanSupported:false; DllScanSupported:false;
use_function_relative_addresses : true use_function_relative_addresses : true;
abi : abi_default
); );
system_m68k_linux_info : tsysteminfo = system_m68k_linux_info : tsysteminfo =
@ -151,7 +152,8 @@ unit i_linux;
heapsize : 128*1024; heapsize : 128*1024;
stacksize : 32*1024*1024; stacksize : 32*1024*1024;
DllScanSupported:false; DllScanSupported:false;
use_function_relative_addresses : true use_function_relative_addresses : true;
abi : abi_default
); );
system_powerpc_linux_info : tsysteminfo = system_powerpc_linux_info : tsysteminfo =
@ -278,7 +280,8 @@ unit i_linux;
heapsize : 256*1024; heapsize : 256*1024;
stacksize : 32*1024*1024; stacksize : 32*1024*1024;
DllScanSupported:false; DllScanSupported:false;
use_function_relative_addresses : true use_function_relative_addresses : true;
abi : abi_default
); );
system_x86_64_linux_info : tsysteminfo = system_x86_64_linux_info : tsysteminfo =
@ -341,7 +344,8 @@ unit i_linux;
heapsize : 256*1024; heapsize : 256*1024;
stacksize : 256*1024; stacksize : 256*1024;
DllScanSupported:false; DllScanSupported:false;
use_function_relative_addresses : true use_function_relative_addresses : true;
abi : abi_default
); );
system_sparc_linux_info : tsysteminfo = system_sparc_linux_info : tsysteminfo =
@ -404,7 +408,8 @@ unit i_linux;
heapsize : 256*1024; heapsize : 256*1024;
stacksize : 262144; stacksize : 262144;
DllScanSupported:false; DllScanSupported:false;
use_function_relative_addresses : true use_function_relative_addresses : true;
abi : abi_default
); );
system_arm_linux_info : tsysteminfo = system_arm_linux_info : tsysteminfo =
@ -467,7 +472,8 @@ unit i_linux;
heapsize : 256*1024; heapsize : 256*1024;
stacksize : 262144; stacksize : 262144;
DllScanSupported:false; DllScanSupported:false;
use_function_relative_addresses : true use_function_relative_addresses : true;
abi : abi_default
); );
implementation implementation
@ -514,7 +520,10 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.29 2004-08-15 13:30:18 florian Revision 1.30 2004-10-24 13:36:26 peter
* gc-sections added when section smartlinking is used
Revision 1.29 2004/08/15 13:30:18 florian
* fixed alignment of variant records * fixed alignment of variant records
* more alignment problems fixed * more alignment problems fixed

View File

@ -211,7 +211,7 @@ var
begin begin
with Info do with Info do
begin begin
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $RES'; ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $RES';
DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES'; DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
DllCmd[2]:='strip --strip-unneeded $EXE'; DllCmd[2]:='strip --strip-unneeded $EXE';
{$ifdef m68k} {$ifdef m68k}
@ -436,6 +436,7 @@ var
cmdstr : TCmdStr; cmdstr : TCmdStr;
success : boolean; success : boolean;
DynLinkStr : string[60]; DynLinkStr : string[60];
GCSectionsStr,
StaticStr, StaticStr,
StripStr : string[40]; StripStr : string[40];
begin begin
@ -445,11 +446,15 @@ begin
{ Create some replacements } { Create some replacements }
StaticStr:=''; StaticStr:='';
StripStr:=''; StripStr:='';
GCSectionsStr:='';
DynLinkStr:=''; DynLinkStr:='';
if (cs_link_staticflag in aktglobalswitches) then if (cs_link_staticflag in aktglobalswitches) then
StaticStr:='-static'; StaticStr:='-static';
if (cs_link_strip in aktglobalswitches) then if (cs_link_strip in aktglobalswitches) then
StripStr:='-s'; StripStr:='-s';
if (cs_link_smart in aktglobalswitches) and
(tf_smartlink_sections in target_info.flags) then
GCSectionsStr:='--gc-sections';
If (cs_profile in aktmoduleswitches) or If (cs_profile in aktmoduleswitches) or
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
begin begin
@ -470,6 +475,7 @@ begin
Replace(cmdstr,'$RES',outputexedir+Info.ResName); Replace(cmdstr,'$RES',outputexedir+Info.ResName);
Replace(cmdstr,'$STATIC',StaticStr); Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr); Replace(cmdstr,'$DYNLINK',DynLinkStr);
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false); success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
@ -579,7 +585,10 @@ end.
{ {
$Log$ $Log$
Revision 1.25 2004-10-14 18:16:17 mazen Revision 1.26 2004-10-24 13:36:26 peter
* gc-sections added when section smartlinking is used
Revision 1.25 2004/10/14 18:16:17 mazen
* USE_SYSUTILS merged successfully : cycles with and without defines * USE_SYSUTILS merged successfully : cycles with and without defines
* Need to be optimized in performance * Need to be optimized in performance