浏览代码

morphos: added section smartlinking support using vlink. needs vlink nightly

git-svn-id: trunk@35242 -
Károly Balogh 8 年之前
父节点
当前提交
48de52f41b
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 1 1
      compiler/systems/i_morph.pas
  2. 7 2
      compiler/systems/t_morph.pas

+ 1 - 1
compiler/systems/i_morph.pas

@@ -34,7 +34,7 @@ unit i_morph;
             system       : system_powerpc_MorphOS;
             name         : 'MorphOS';
             shortname    : 'MorphOS';
-            flags        : [tf_files_case_aware,tf_requires_proper_alignment,tf_smartlink_library,tf_has_winlike_resources];
+            flags        : [tf_files_case_aware,tf_requires_proper_alignment,tf_smartlink_sections,tf_has_winlike_resources];
             cpu          : cpu_powerpc;
             unit_env     : 'MORPHOSUNITS';
             extradefines : 'HASAMIGA';

+ 7 - 2
compiler/systems/t_morph.pas

@@ -31,7 +31,7 @@ implementation
 
     uses
        SysUtils,
-       cutils,cfileutl,cclasses,rescmn,comprsrc,
+       cutils,cfileutl,cclasses,rescmn,comprsrc,aasmbase,
        globtype,globals,systems,verbose,script,fmodule,i_morph,link;
 
     type
@@ -74,7 +74,7 @@ begin
      end
     else
      begin
-      ExeCmd[1]:='vlink -b elf32amiga $OPT $STRIP -o $EXE -T $RES';
+      ExeCmd[1]:='vlink -b elf32amiga $OPT $STRIP $GCSECTIONS -o $EXE -T $RES';
      end;
    end;
 end;
@@ -208,9 +208,11 @@ var
   binstr,
   cmdstr  : TCmdStr;
   success : boolean;
+  GCSectionsStr: string;
   StripStr: string[40];
 begin
   StripStr:='';
+  GCSectionsStr:='';
 
   if not(cs_link_nolink in current_settings.globalswitches) then
    Message1(exec_i_linking,current_module.exefilename);
@@ -219,6 +221,8 @@ begin
    begin
     if (cs_link_strip in current_settings.globalswitches) then
      StripStr:='-s -P __abox__';
+    if create_smartlink_sections then
+     GCSectionsStr:='-gc-all -sc -sd';
    end;
 
 { Write used files and libraries }
@@ -232,6 +236,7 @@ begin
     Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
     Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
     Replace(cmdstr,'$STRIP',StripStr);
+    Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
    end
   else
    begin