Selaa lähdekoodia

morphos: support section GC with GNU LD as well

git-svn-id: trunk@41105 -
Károly Balogh 6 vuotta sitten
vanhempi
commit
d1878fe5b2
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      compiler/systems/t_morph.pas

+ 7 - 1
compiler/systems/t_morph.pas

@@ -69,7 +69,7 @@ begin
    begin
     if not UseVLink then
      begin
-      ExeCmd[1]:='ld $OPT -o $EXE $RES';
+      ExeCmd[1]:='ld $OPT $GCSECTIONS -o $EXE $RES';
       ExeCmd[2]:='strip --strip-unneeded --remove-section .comment $EXE';
      end
     else
@@ -223,6 +223,11 @@ begin
      StripStr:='-s -P __abox__';
     if create_smartlink_sections then
      GCSectionsStr:='-gc-all -sc -sd';
+   end
+  else
+   begin
+    if create_smartlink_sections then
+     GCSectionsStr:='--gc-sections -e _start';
    end;
 
 { Write used files and libraries }
@@ -242,6 +247,7 @@ begin
    begin
     Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename)));
     Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
+    Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
    end;
   success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);