Răsfoiți Sursa

* Changed linking infrastructure to look like assembler one:
* Changed direct references to linker classes in TSystemInfo records to enumerated ids.
* RegisterExtennalLinker and RegisterInternalLinker procedures replaced by single RegisterLinker procedure and moved to link.pas.
- TAbstractLinker is no longer necessary, removed.

This change allows to register linker once per id, rather than once per target, and also allows TSystemInfo records to be read-only.

git-svn-id: trunk@25279 -

sergei 12 ani în urmă
părinte
comite
38058505ba
57 a modificat fișierele cu 224 adăugiri și 248 ștergeri
  1. 17 11
      compiler/link.pas
  2. 1 1
      compiler/options.pas
  3. 33 0
      compiler/systems.inc
  4. 2 32
      compiler/systems.pas
  5. 4 4
      compiler/systems/i_aix.pas
  6. 4 4
      compiler/systems/i_amiga.pas
  7. 4 4
      compiler/systems/i_android.pas
  8. 2 2
      compiler/systems/i_beos.pas
  9. 28 28
      compiler/systems/i_bsd.pas
  10. 6 6
      compiler/systems/i_embed.pas
  11. 2 2
      compiler/systems/i_emx.pas
  12. 2 2
      compiler/systems/i_gba.pas
  13. 2 2
      compiler/systems/i_go32v2.pas
  14. 2 2
      compiler/systems/i_haiku.pas
  15. 4 4
      compiler/systems/i_jvm.pas
  16. 28 28
      compiler/systems/i_linux.pas
  17. 2 2
      compiler/systems/i_macos.pas
  18. 2 2
      compiler/systems/i_morph.pas
  19. 2 2
      compiler/systems/i_msdos.pas
  20. 2 2
      compiler/systems/i_nativent.pas
  21. 2 2
      compiler/systems/i_nds.pas
  22. 2 2
      compiler/systems/i_nwl.pas
  23. 2 2
      compiler/systems/i_nwm.pas
  24. 2 2
      compiler/systems/i_os2.pas
  25. 4 4
      compiler/systems/i_palmos.pas
  26. 6 6
      compiler/systems/i_sunos.pas
  27. 4 4
      compiler/systems/i_symbian.pas
  28. 2 2
      compiler/systems/i_watcom.pas
  29. 2 2
      compiler/systems/i_wdosx.pas
  30. 2 2
      compiler/systems/i_wii.pas
  31. 8 8
      compiler/systems/i_win.pas
  32. 1 2
      compiler/systems/t_aix.pas
  33. 2 2
      compiler/systems/t_amiga.pas
  34. 1 2
      compiler/systems/t_android.pas
  35. 1 1
      compiler/systems/t_beos.pas
  36. 1 16
      compiler/systems/t_bsd.pas
  37. 3 3
      compiler/systems/t_embed.pas
  38. 1 1
      compiler/systems/t_emx.pas
  39. 1 1
      compiler/systems/t_gba.pas
  40. 2 2
      compiler/systems/t_go32v2.pas
  41. 1 1
      compiler/systems/t_haiku.pas
  42. 1 3
      compiler/systems/t_jvm.pas
  43. 2 11
      compiler/systems/t_linux.pas
  44. 1 1
      compiler/systems/t_macos.pas
  45. 1 1
      compiler/systems/t_morph.pas
  46. 3 3
      compiler/systems/t_msdos.pas
  47. 1 1
      compiler/systems/t_nativent.pas
  48. 1 1
      compiler/systems/t_nds.pas
  49. 1 1
      compiler/systems/t_nwl.pas
  50. 2 2
      compiler/systems/t_nwm.pas
  51. 1 1
      compiler/systems/t_os2.pas
  52. 1 3
      compiler/systems/t_sunos.pas
  53. 5 2
      compiler/systems/t_symbian.pas
  54. 1 1
      compiler/systems/t_watcom.pas
  55. 1 1
      compiler/systems/t_wdosx.pas
  56. 1 1
      compiler/systems/t_wii.pas
  57. 2 8
      compiler/systems/t_win.pas

+ 17 - 11
compiler/link.pas

@@ -46,7 +46,7 @@ interface
         DynamicLinker : string[100];
       end;
 
-      TLinker = class(TAbstractLinker)
+      TLinker = class(TObject)
       public
          HasResources,
          HasExports      : boolean;
@@ -132,6 +132,8 @@ interface
          procedure AddImportSymbol(const libname,symname,symmangledname:TCmdStr;OrdNr: longint;isvar:boolean);override;
        end;
 
+      TLinkerClass = class of Tlinker;
+
     var
       Linker  : TLinker;
 
@@ -139,6 +141,8 @@ interface
     function FindLibraryFile(s:TCmdStr;const prefix,ext:TCmdStr;var foundfile : TCmdStr) : boolean;
     function FindDLL(const s:TCmdStr;var founddll:TCmdStr):boolean;
 
+    procedure RegisterLinker(id:tlink;c:TLinkerClass);
+
     procedure InitLinker;
     procedure DoneLinker;
 
@@ -154,8 +158,8 @@ Implementation
       aasmbase,aasmtai,aasmdata,aasmcpu,
       owbase,owar,ogmap;
 
-    type
-     TLinkerClass = class of Tlinker;
+    var
+      CLinker : array[tlink] of TLinkerClass;
 
 {*****************************************************************************
                                    Helpers
@@ -1520,21 +1524,23 @@ Implementation
                                  Init/Done
 *****************************************************************************}
 
+    procedure RegisterLinker(id:tlink;c:TLinkerClass);
+      begin
+        CLinker[id]:=c;
+      end;
+
+
     procedure InitLinker;
-      var
-        lk : TlinkerClass;
       begin
         if (cs_link_extern in current_settings.globalswitches) and
-           assigned(target_info.linkextern) then
+           assigned(CLinker[target_info.linkextern]) then
           begin
-            lk:=TlinkerClass(target_info.linkextern);
-            linker:=lk.Create;
+            linker:=CLinker[target_info.linkextern].Create;
           end
         else
-          if assigned(target_info.link) then
+          if assigned(CLinker[target_info.link]) then
             begin
-              lk:=TLinkerClass(target_info.link);
-              linker:=lk.Create;
+              linker:=CLinker[target_info.link].Create;
             end
         else
           linker:=Tlinker.Create;

+ 1 - 1
compiler/options.pas

@@ -3225,7 +3225,7 @@ begin
   { Force use of external linker if there is no
     internal linker or the linking is skipped }
   if not(cs_link_extern in init_settings.globalswitches) and
-     (not assigned(target_info.link) or
+     ((target_info.link=ld_none) or
       (cs_link_nolink in init_settings.globalswitches)) then
     include(init_settings.globalswitches,cs_link_extern);
 

+ 33 - 0
compiler/systems.inc

@@ -197,6 +197,39 @@
              ,as_jvm_jasmin
        );
 
+       tlink = (ld_none,
+             ld_aix,           { external linkers (one per OS, handles all CPUs) }
+             ld_amiga,
+             ld_android,
+             ld_beos,
+             ld_bsd,
+             ld_embedded,
+             ld_emx,
+             ld_gba,
+             ld_go32v2,
+             ld_haiku,
+             ld_jvm,
+             ld_linux,
+             ld_morphos,
+             ld_mpw,
+             ld_msdos,
+             ld_nds,
+             ld_netwlibc,
+             ld_netware,
+             ld_os2,
+             ld_palmos,
+             ld_solaris,
+             ld_watcom,
+             ld_wdosx,
+             ld_wii,
+             ld_windows,
+             ld_int_go32v2,    { implemented internal linkers }
+             ld_int_linux,
+             ld_int_nativent,
+             ld_int_netware,
+             ld_int_windows
+       );
+
        tar = (ar_none
             ,ar_gnu_ar
             ,ar_mpw_ar

+ 2 - 32
compiler/systems.pas

@@ -33,13 +33,6 @@ interface
 *****************************************************************************}
 
      type
-       { Abstract linker class which is implemented in link module }
-       TAbstractLinker = class
-       end;
-
-       TAbstractLinkerClass = class of TAbstractLinker;
-
-
        TAbstractResourceFile = class
          constructor create(const fn : ansistring);virtual;abstract;
        end;
@@ -187,8 +180,8 @@ interface
           dirsep       : char;
           assem        : tasm;
           assemextern  : tasm; { external assembler, used by -a }
-          link         : tabstractlinkerclass;
-          linkextern   : tabstractlinkerclass;  { external linker, used by -s }
+          link         : tlink;
+          linkextern   : tlink;  { external linker, used by -s }
           ar           : tar;
           res          : tres;
           dbg          : tdbg;
@@ -387,19 +380,6 @@ interface
     procedure RegisterTarget(const r:tsysteminfo);
     procedure RegisterRes(const r:tresinfo; rcf : TAbstractResourceFileClass);
     procedure RegisterAr(const r:tarinfo);
-    { Register the external linker. This routine is called to setup the
-      class to use for the linker. It returns the tsysteminfo structure
-      updated with the correct linker class for external linking.
-    }
-    procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
-    { Register the internal linker. This routine is called to setup the
-      class to use for the linker. It returns the tsysteminfo structure
-      updated with the correct linker class for internal linking.
-
-      If internal linking is not supported, this class can be set
-      to nil.
-    }
-    procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
 
     procedure InitSystems;
 
@@ -662,16 +642,6 @@ begin
   arinfos[t]^:=r;
 end;
 
-procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
-begin
-  system_info.linkextern := c;
-end;
-
-procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
-begin
-  system_info.link := c;
-end;
-
 
 
 procedure DeregisterInfos;

+ 4 - 4
compiler/systems/i_aix.pas

@@ -64,8 +64,8 @@ unit i_aix;
             dirsep       : '/';
             assem        : as_powerpc_xcoff;
             assemextern  : as_powerpc_xcoff;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_aix;
             ar           : ar_gnu_ar;
             res          : res_xcoff;
             dbg          : dbg_stabx;
@@ -127,8 +127,8 @@ unit i_aix;
             dirsep       : '/';
             assem        : as_powerpc_xcoff;
             assemextern  : as_powerpc_xcoff;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_aix;
             ar           : ar_gnu_ar;
             res          : res_xcoff;
             dbg          : dbg_stabx;

+ 4 - 4
compiler/systems/i_amiga.pas

@@ -63,8 +63,8 @@ unit i_amiga;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_amiga;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;
@@ -125,8 +125,8 @@ unit i_amiga;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_amiga;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_android.pas

@@ -65,8 +65,8 @@ unit i_android;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_android;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -130,8 +130,8 @@ unit i_android;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_android;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_beos.pas

@@ -64,8 +64,8 @@ unit i_beos;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_beos;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 28 - 28
compiler/systems/i_bsd.pas

@@ -93,8 +93,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -159,8 +159,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
@@ -222,8 +222,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -284,8 +284,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -349,8 +349,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
@@ -411,8 +411,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -473,8 +473,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -539,8 +539,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
@@ -601,8 +601,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_macho;
             dbg          : dbg_stabs;
@@ -665,8 +665,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_macho;
             dbg          : dbg_stabs;
@@ -729,8 +729,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_macho;
             dbg          : dbg_dwarf2;
@@ -793,8 +793,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_macho;
             dbg          : dbg_dwarf2;
@@ -857,8 +857,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_macho;
             dbg          : dbg_dwarf2;
@@ -920,8 +920,8 @@ unit i_bsd;
             dirsep       : '/';
             assem        : as_darwin;
             assemextern  : as_darwin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_bsd;
             ar           : ar_gnu_ar;
             res          : res_macho;
             dbg          : dbg_dwarf2;

+ 6 - 6
compiler/systems/i_embed.pas

@@ -63,8 +63,8 @@ unit i_embed;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_embedded;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;
@@ -126,8 +126,8 @@ unit i_embed;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_embedded;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_dwarf2;
@@ -189,8 +189,8 @@ unit i_embed;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_embedded;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_emx.pas

@@ -74,8 +74,8 @@ unit i_emx;
             dirsep       : '\';
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_emx;
             ar           : ar_gnu_ar;
             res          : res_watcom_wrc_os2;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_gba.pas

@@ -64,8 +64,8 @@ unit i_gba;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_gba;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_go32v2.pas

@@ -63,8 +63,8 @@ unit i_go32v2;
             dirsep       : '\';
             assem        : as_i386_coff;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_go32v2;
+            linkextern   : ld_go32v2;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_haiku.pas

@@ -65,8 +65,8 @@ unit i_haiku;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_haiku;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_jvm.pas

@@ -81,8 +81,8 @@ unit i_jvm;
             dirsep       : '/';
             assem        : as_jvm_jasmin;
             assemextern  : as_jvm_jasmin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_jvm;
             ar           : ar_none;
             res          : res_jvm_raw;
             dbg          : dbg_jasmin;
@@ -146,8 +146,8 @@ unit i_jvm;
             dirsep       : '/';
             assem        : as_jvm_jasmin;
             assemextern  : as_jvm_jasmin;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_jvm;
             ar           : ar_none;
             res          : res_jvm_raw;
             dbg          : dbg_jasmin;

+ 28 - 28
compiler/systems/i_linux.pas

@@ -69,8 +69,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -133,8 +133,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -197,8 +197,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -261,8 +261,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -324,8 +324,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_dwarf2;
@@ -387,8 +387,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -451,8 +451,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_x86_64_elf64;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_dwarf2;
@@ -517,8 +517,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -582,8 +582,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -647,8 +647,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -712,8 +712,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -776,8 +776,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -844,8 +844,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -909,8 +909,8 @@ unit i_linux;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_macos.pas

@@ -62,8 +62,8 @@ unit i_macos;
             dirsep       : ':';
             assem        : as_powerpc_mpw;
             assemextern  : as_powerpc_mpw;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_mpw;
             ar           : ar_mpw_ar;
             res          : res_powerpc_mpw;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_morph.pas

@@ -63,8 +63,8 @@ unit i_morph;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_morphos;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_msdos.pas

@@ -64,8 +64,8 @@ unit i_msdos;
             dirsep       : '\';
             assem        : as_i386_nasmobj;
             assemextern  : as_i386_nasmobj;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_msdos;
             ar           : ar_watcom_wlib_omf;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nativent.pas

@@ -68,8 +68,8 @@ unit i_nativent;
             dirsep       : '\';
             assem        : as_i386_pecoff;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_nativent;
+            linkextern   : ld_none;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nds.pas

@@ -64,8 +64,8 @@ unit i_nds;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_nds;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nwl.pas

@@ -63,8 +63,8 @@ unit i_nwl;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_netwlibc;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_nwm.pas

@@ -63,8 +63,8 @@ unit i_nwm;
             dirsep       : '/';
             assem        : as_i386_nlmcoff; // as_i386_elf32;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_netware;
+            linkextern   : ld_netware;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_os2.pas

@@ -74,8 +74,8 @@ unit i_os2;
             dirsep       : '\';
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_os2;
             ar           : ar_gnu_ar;
             res          : res_watcom_wrc_os2;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_palmos.pas

@@ -63,8 +63,8 @@ unit i_palmos;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_palmos;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;
@@ -136,8 +136,8 @@ unit i_palmos;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_palmos;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 6 - 6
compiler/systems/i_sunos.pas

@@ -65,8 +65,8 @@ unit i_sunos;
             dirsep       : '/';
             assem        : as_i386_elf32;
             assemextern  : as_ggas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_solaris;
             ar           : ar_gnu_gar;
             res          : res_elf;
             dbg          : dbg_stabs;
@@ -132,8 +132,8 @@ unit i_sunos;
             dirsep       : '/';
             assem        : as_ggas{as_x86_64_elf64};
             assemextern  : as_ggas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_solaris;
             ar           : ar_gnu_ar;
             res          : res_elf;
             dbg          : dbg_dwarf2;
@@ -199,8 +199,8 @@ unit i_sunos;
             dirsep       : '/';
             assem        : as_ggas;
             assemextern  : as_ggas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_solaris;
             ar           : ar_gnu_gar;
             res          : res_elf;
             dbg          : dbg_stabs;

+ 4 - 4
compiler/systems/i_symbian.pas

@@ -65,8 +65,8 @@ unit i_symbian;
             dirsep       : '\';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_windows;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;
@@ -128,8 +128,8 @@ unit i_symbian;
             dirsep       : '\';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_windows;
+            linkextern   : ld_none;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_watcom.pas

@@ -63,8 +63,8 @@ unit i_watcom;
             dirsep       : '\';
             assem        : as_i386_wasm;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_watcom;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_wdosx.pas

@@ -63,8 +63,8 @@ unit i_wdosx;
             dirsep       : '\';
             assem        : as_i386_pecoffwdosx;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_wdosx;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;

+ 2 - 2
compiler/systems/i_wii.pas

@@ -63,8 +63,8 @@ unit i_wii;
             dirsep       : '/';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_none;
+            linkextern   : ld_wii;
             ar           : ar_gnu_ar;
             res          : res_none;
             dbg          : dbg_stabs;

+ 8 - 8
compiler/systems/i_win.pas

@@ -68,8 +68,8 @@ unit i_win;
             dirsep       : '\';
             assem        : as_i386_pecoff;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_windows;
+            linkextern   : ld_windows;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;
@@ -135,8 +135,8 @@ unit i_win;
             dirsep       : '\';
             assem        : as_x86_64_pecoff;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_windows;
+            linkextern   : ld_windows;
             ar           : ar_gnu_ar;
             res          : res_win64_gorc;
             dbg          : dbg_dwarf2;
@@ -200,8 +200,8 @@ unit i_win;
             dirsep       : '\';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_windows;
+            linkextern   : ld_windows;
             ar           : ar_gnu_ar_scripted;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;
@@ -265,8 +265,8 @@ unit i_win;
             dirsep       : '\';
             assem        : as_i386_pecoffwince;
             assemextern  : as_gas;
-            link         : nil;
-            linkextern   : nil;
+            link         : ld_int_windows;
+            linkextern   : ld_windows;
             ar           : ar_gnu_ar_scripted;
             res          : res_gnu_windres;
             dbg          : dbg_stabs;

+ 1 - 2
compiler/systems/t_aix.pas

@@ -414,14 +414,13 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_aix,TLinkerAIX);
 {$ifdef powerpc}
-  RegisterExternalLinker(system_powerpc_aix_info,TLinkerAIX);
   RegisterImport(system_powerpc_aix,timportlibaix);
   RegisterExport(system_powerpc_aix,texportlibaix);
   RegisterTarget(system_powerpc_aix_info);
 {$endif powerpc}
 {$ifdef powerpc64}
-  RegisterExternalLinker(system_powerpc64_aix_info,TLinkerAIX);
   RegisterImport(system_powerpc64_aix,timportlibaix);
   RegisterExport(system_powerpc64_aix,texportlibaix);
   RegisterTarget(system_powerpc64_aix_info);

+ 2 - 2
compiler/systems/t_amiga.pas

@@ -277,11 +277,11 @@ end;
 initialization
 {$ifdef m68k}
 { TODO: No executable creation support for m68k yet!}
-  RegisterExternalLinker(system_m68k_Amiga_info,TLinkerAmiga);
+  RegisterLinker(ld_amiga,TLinkerAmiga);
   RegisterTarget(system_m68k_Amiga_info);
 {$endif m68k}
 {$ifdef powerpc}
-  RegisterExternalLinker(system_powerpc_Amiga_info,TLinkerAmiga);
+  RegisterLinker(ld_amiga,TLinkerAmiga);
   RegisterTarget(system_powerpc_Amiga_info);
 {$endif powerpc}
 end.

+ 1 - 2
compiler/systems/t_android.pas

@@ -424,14 +424,13 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_android,TLinkerAndroid);
 {$ifdef ARM}
-  RegisterExternalLinker(system_arm_android_info,TLinkerAndroid);
   RegisterImport(system_arm_android,timportlibandroid);
   RegisterExport(system_arm_android,texportlibandroid);
   RegisterTarget(system_arm_android_info);
 {$endif ARM}
 {$ifdef I386}
-  RegisterExternalLinker(system_i386_android_info,TLinkerAndroid);
   RegisterImport(system_i386_android,timportlibandroid);
   RegisterExport(system_i386_android,texportlibandroid);
   RegisterTarget(system_i386_android_info);

+ 1 - 1
compiler/systems/t_beos.pas

@@ -491,8 +491,8 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_beos,TLinkerbeos);
 {$ifdef i386}
-  RegisterExternalLinker(system_i386_beos_info,TLinkerbeos);
   RegisterImport(system_i386_beos,timportlibbeos);
   RegisterExport(system_i386_beos,texportlibbeos);
   RegisterTarget(system_i386_beos_info);

+ 1 - 16
compiler/systems/t_bsd.pas

@@ -879,29 +879,23 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_bsd,TLinkerBSD);
 {$ifdef x86_64}
-  RegisterExternalLinker(system_x86_64_FreeBSD_info,TLinkerBSD);
   RegisterImport(system_x86_64_freebsd,timportlibbsd);
   RegisterExport(system_x86_64_freebsd,texportlibbsd);
   RegisterTarget(system_x86_64_freebsd_info);
-  RegisterExternalLinker(system_x86_64_OpenBSD_info,TLinkerBSD);
   RegisterImport(system_x86_64_openbsd,timportlibbsd);
   RegisterExport(system_x86_64_openbsd,texportlibbsd);
   RegisterTarget(system_x86_64_openbsd_info);
-  RegisterExternalLinker(system_x86_64_NetBSD_info,TLinkerBSD);
   RegisterImport(system_x86_64_netbsd,timportlibbsd);
   RegisterExport(system_x86_64_netbsd,texportlibbsd);
   RegisterTarget(system_x86_64_netbsd_info);
 
-  RegisterExternalLinker(system_x86_64_darwin_info,TLinkerBSD);
   RegisterImport(system_x86_64_darwin,timportlibdarwin);
   RegisterExport(system_x86_64_darwin,texportlibdarwin);
   RegisterTarget(system_x86_64_darwin_info);
 {$endif}
 {$ifdef i386}
-  RegisterExternalLinker(system_i386_FreeBSD_info,TLinkerBSD);
-  RegisterExternalLinker(system_i386_NetBSD_info,TLinkerBSD);
-  RegisterExternalLinker(system_i386_OpenBSD_info,TLinkerBSD);
   RegisterImport(system_i386_freebsd,timportlibbsd);
   RegisterExport(system_i386_freebsd,texportlibbsd);
   RegisterTarget(system_i386_freebsd_info);
@@ -911,42 +905,33 @@ initialization
   RegisterImport(system_i386_openbsd,timportlibbsd);
   RegisterExport(system_i386_openbsd,texportlibbsd);
   RegisterTarget(system_i386_openbsd_info);
-  RegisterExternalLinker(system_i386_darwin_info,TLinkerBSD);
   RegisterImport(system_i386_darwin,timportlibdarwin);
   RegisterExport(system_i386_darwin,texportlibdarwin);
   RegisterTarget(system_i386_darwin_info);
-  RegisterExternalLinker(system_i386_iphonesim_info,TLinkerBSD);
   RegisterImport(system_i386_iphonesim,timportlibdarwin);
   RegisterExport(system_i386_iphonesim,texportlibdarwin);
   RegisterTarget(system_i386_iphonesim_info);
 {$endif i386}
 {$ifdef m68k}
-//  RegisterExternalLinker(system_m68k_FreeBSD_info,TLinkerBSD);
-  RegisterExternalLinker(system_m68k_NetBSD_info,TLinkerBSD);
   RegisterImport(system_m68k_netbsd,timportlibbsd);
   RegisterExport(system_m68k_netbsd,texportlibbsd);
   RegisterTarget(system_m68k_netbsd_info);
 {$endif m68k}
 {$ifdef powerpc}
-//  RegisterExternalLinker(system_m68k_FreeBSD_info,TLinkerBSD);
-  RegisterExternalLinker(system_powerpc_darwin_info,TLinkerBSD);
   RegisterImport(system_powerpc_darwin,timportlibdarwin);
   RegisterExport(system_powerpc_darwin,texportlibdarwin);
   RegisterTarget(system_powerpc_darwin_info);
 
-  RegisterExternalLinker(system_powerpc_netbsd_info,TLinkerBSD);
   RegisterImport(system_powerpc_netbsd,timportlibbsd);
   RegisterExport(system_powerpc_netbsd,texportlibbsd);
   RegisterTarget(system_powerpc_netbsd_info);
 {$endif powerpc}
 {$ifdef powerpc64}
-  RegisterExternalLinker(system_powerpc64_darwin_info,TLinkerBSD);
   RegisterImport(system_powerpc64_darwin,timportlibdarwin);
   RegisterExport(system_powerpc64_darwin,texportlibdarwin);
   RegisterTarget(system_powerpc64_darwin_info);
 {$endif powerpc64}
 {$ifdef arm}
-  RegisterExternalLinker(system_arm_darwin_info,TLinkerBSD);
   RegisterImport(system_arm_darwin,timportlibdarwin);
   RegisterExport(system_arm_darwin,texportlibdarwin);
   RegisterTarget(system_arm_darwin_info);

+ 3 - 3
compiler/systems/t_embed.pas

@@ -1031,17 +1031,17 @@ function TLinkerEmbedded.postprocessexecutable(const fn : string;isdll:boolean):
 
 initialization
 {$ifdef arm}
-  RegisterExternalLinker(system_arm_embedded_info,TlinkerEmbedded);
+  RegisterLinker(ld_embedded,TLinkerEmbedded);
   RegisterTarget(system_arm_embedded_info);
 {$endif arm}
 
 {$ifdef avr}
-  RegisterExternalLinker(system_avr_embedded_info,TlinkerEmbedded);
+  RegisterLinker(ld_embedded,TLinkerEmbedded);
   RegisterTarget(system_avr_embedded_info);
 {$endif avr}
 
 {$ifdef i386}
-  RegisterExternalLinker(system_i386_embedded_info,TlinkerEmbedded);
+  RegisterLinker(ld_embedded,TLinkerEmbedded);
   RegisterTarget(system_i386_embedded_info);
 {$endif i386}
 end.

+ 1 - 1
compiler/systems/t_emx.pas

@@ -542,7 +542,7 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_i386_emx_info,TLinkerEMX);
+  RegisterLinker(ld_emx,TLinkerEMX);
   RegisterImport(system_i386_emx,TImportLibEMX);
   RegisterRes(res_wrc_os2_info,TResourceFile);
   RegisterTarget(system_i386_emx_info);

+ 1 - 1
compiler/systems/t_gba.pas

@@ -627,6 +627,6 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_arm_gba_info,TLinkerGba);
+  RegisterLinker(ld_gba,TLinkerGba);
   RegisterTarget(system_arm_gba_info);
 end.

+ 2 - 2
compiler/systems/t_go32v2.pas

@@ -511,7 +511,7 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_i386_go32v2_info,TExternalLinkerGo32v2);
-  RegisterInternalLinker(system_i386_go32v2_info,TInternalLinkerGo32v2);
+  RegisterLinker(ld_go32v2,TExternalLinkerGo32v2);
+  RegisterLinker(ld_int_go32v2,TInternalLinkerGo32v2);
   RegisterTarget(system_i386_go32v2_info);
 end.

+ 1 - 1
compiler/systems/t_haiku.pas

@@ -491,8 +491,8 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_haiku,TLinkerhaiku);
 {$ifdef i386}
-  RegisterExternalLinker(system_i386_haiku_info,TLinkerhaiku);
   RegisterImport(system_i386_haiku,timportlibhaiku);
   RegisterExport(system_i386_haiku,texportlibhaiku);
   RegisterTarget(system_i386_haiku_info);

+ 1 - 3
compiler/systems/t_jvm.pas

@@ -94,13 +94,11 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_jvm_java32_info, tlinkerjvm);
+  RegisterLinker(ld_jvm, tlinkerjvm);
   RegisterImport(system_jvm_java32,timportlibjvm);
   RegisterExport(system_jvm_java32,texportlibjvm);
   RegisterTarget(system_jvm_java32_info);
 
-
-  RegisterExternalLinker(system_jvm_android32_info, tlinkerjvm);
   RegisterImport(system_jvm_android32,timportlibjvm);
   RegisterExport(system_jvm_android32,texportlibjvm);
   RegisterTarget(system_jvm_android32_info);

+ 2 - 11
compiler/systems/t_linux.pas

@@ -1497,67 +1497,58 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_linux,TLinkerLinux);
+  RegisterLinker(ld_int_linux,TInternalLinkerLinux);
 {$ifdef i386}
-  RegisterExternalLinker(system_i386_linux_info,TLinkerLinux);
   RegisterImport(system_i386_linux,timportliblinux);
   RegisterExport(system_i386_linux,texportliblinux);
   RegisterTarget(system_i386_linux_info);
 
-  RegisterExternalLinker(system_x86_6432_linux_info,TLinkerLinux);
   RegisterImport(system_x86_6432_linux,timportliblinux);
   RegisterExport(system_x86_6432_linux,texportliblinux);
   RegisterTarget(system_x86_6432_linux_info);
 {$endif i386}
 {$ifdef m68k}
-  RegisterExternalLinker(system_m68k_linux_info,TLinkerLinux);
   RegisterImport(system_m68k_linux,timportliblinux);
   RegisterExport(system_m68k_linux,texportliblinux);
   RegisterTarget(system_m68k_linux_info);
 {$endif m68k}
 {$ifdef powerpc}
-  RegisterExternalLinker(system_powerpc_linux_info,TLinkerLinux);
   RegisterImport(system_powerpc_linux,timportliblinux);
   RegisterExport(system_powerpc_linux,texportliblinux);
   RegisterTarget(system_powerpc_linux_info);
 {$endif powerpc}
 {$ifdef powerpc64}
-  RegisterExternalLinker(system_powerpc64_linux_info,TLinkerLinux);
   RegisterImport(system_powerpc64_linux,timportliblinux);
   RegisterExport(system_powerpc64_linux,texportliblinux);
   RegisterTarget(system_powerpc64_linux_info);
 {$endif powerpc64}
 {$ifdef alpha}
-  RegisterExternalLinker(system_alpha_linux_info,TLinkerLinux);
   RegisterImport(system_alpha_linux,timportliblinux);
   RegisterExport(system_alpha_linux,texportliblinux);
   RegisterTarget(system_alpha_linux_info);
 {$endif alpha}
 {$ifdef x86_64}
-  RegisterExternalLinker(system_x86_64_linux_info,TLinkerLinux);
   RegisterImport(system_x86_64_linux,timportliblinux);
   RegisterExport(system_x86_64_linux,texportliblinux);
   RegisterTarget(system_x86_64_linux_info);
 {$endif x86_64}
 {$ifdef SPARC}
-  RegisterExternalLinker(system_sparc_linux_info,TLinkerLinux);
   RegisterImport(system_SPARC_linux,timportliblinux);
   RegisterExport(system_SPARC_linux,texportliblinux);
   RegisterTarget(system_SPARC_linux_info);
 {$endif SPARC}
 {$ifdef ARM}
-  RegisterExternalLinker(system_arm_linux_info,TLinkerLinux);
   RegisterImport(system_arm_linux,timportliblinux);
   RegisterExport(system_arm_linux,texportliblinux);
   RegisterTarget(system_arm_linux_info);
 {$endif ARM}
 {$ifdef MIPS}
 {$ifdef MIPSEL}
-  RegisterExternalLinker(system_mipsel_linux_info,TLinkerLinux);
   RegisterImport(system_mipsel_linux,timportliblinux);
   RegisterExport(system_mipsel_linux,texportliblinux);
   RegisterTarget(system_mipsel_linux_info);
 {$else MIPS}
-  RegisterExternalLinker(system_mipseb_linux_info,TLinkerLinux);
   RegisterImport(system_mipseb_linux,timportliblinux);
   RegisterExport(system_mipseb_linux,texportliblinux);
   RegisterTarget(system_mipseb_linux_info);

+ 1 - 1
compiler/systems/t_macos.pas

@@ -248,7 +248,7 @@ initialization
   RegisterImport(system_m68k_macos,timportlibmacos);
 {$endif m68k}
 {$ifdef powerpc}
-  RegisterExternalLinker(system_powerpc_macos_info,TLinkerMPW);
+  RegisterLinker(ld_mpw,TLinkerMPW);
   RegisterTarget(system_powerpc_macos_info);
   RegisterImport(system_powerpc_macos,timportlibmacos);
 {$endif powerpc}

+ 1 - 1
compiler/systems/t_morph.pas

@@ -263,6 +263,6 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_powerpc_morphos_info,TLinkerMorphOS);
+  RegisterLinker(ld_morphos,TLinkerMorphOS);
   RegisterTarget(system_powerpc_morphos_info);
 end.

+ 3 - 3
compiler/systems/t_msdos.pas

@@ -332,11 +332,11 @@ end;
 
 initialization
 {$if defined(USE_LINKER_TLINK)}
-  RegisterExternalLinker(system_i8086_msdos_info,TExternalLinkerMsDosTLink);
+  RegisterLinker(ld_msdos,TExternalLinkerMsDosTLink);
 {$elseif defined(USE_LINKER_ALINK)}
-  RegisterExternalLinker(system_i8086_msdos_info,TExternalLinkerMsDosALink);
+  RegisterLinker(ld_msdos,TExternalLinkerMsDosALink);
 {$elseif defined(USE_LINKER_WLINK)}
-  RegisterExternalLinker(system_i8086_msdos_info,TExternalLinkerMsDosWLink);
+  RegisterLinker(ld_msdos,TExternalLinkerMsDosWLink);
 {$else}
   {$fatal no linker defined}
 {$endif}

+ 1 - 1
compiler/systems/t_nativent.pas

@@ -85,7 +85,7 @@ implementation
 initialization
 {$ifdef i386}
   { NativeNT }
-  RegisterInternalLinker(system_i386_nativent_info,TInternalLinkerNativeNT);
+  RegisterLinker(ld_int_nativent,TInternalLinkerNativeNT);
   RegisterImport(system_i386_nativent,TImportLibNativeNT);
   RegisterExport(system_i386_nativent,TExportLibNativeNT);
 //  RegisterRes(res_gnu_windres_info,TWinLikeResourceFile);

+ 1 - 1
compiler/systems/t_nds.pas

@@ -775,6 +775,6 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_arm_nds_info,TLinkerNDS);
+  RegisterLinker(ld_nds,TLinkerNDS);
   RegisterTarget(system_arm_nds_info);
 end.

+ 1 - 1
compiler/systems/t_nwl.pas

@@ -624,7 +624,7 @@ end;
 
 
 initialization
-  RegisterExternalLinker(system_i386_netwlibc_info,TLinkerNetwlibc);
+  RegisterLinker(ld_netwlibc,TLinkerNetwlibc);
   RegisterImport(system_i386_netwlibc,TImportLibNetwlibc);
   RegisterExport(system_i386_netwlibc,TExportLibNetwlibc);
   RegisterTarget(system_i386_netwlibc_info);

+ 2 - 2
compiler/systems/t_nwm.pas

@@ -980,8 +980,8 @@ end;
 
 
 initialization
-  RegisterExternalLinker(system_i386_netware_info,TLinkerNetware);
-  RegisterInternalLinker(system_i386_netware_info,TInternalLinkerNetware);
+  RegisterLinker(ld_netware,TLinkerNetware);
+  RegisterLinker(ld_int_netware,TInternalLinkerNetware);
   RegisterImport(system_i386_netware,TImportLibNetware);
   RegisterExport(system_i386_netware,TExportLibNetware);
   RegisterTarget(system_i386_netware_info);

+ 1 - 1
compiler/systems/t_os2.pas

@@ -557,7 +557,7 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_i386_os2_info,TLinkerOS2);
+  RegisterLinker(ld_os2,TLinkerOS2);
   RegisterImport(system_i386_os2,TImportLibOS2);
 {  RegisterRes(res_wrc_os2_info,TResourceFile);}
   RegisterTarget(system_i386_os2_info);

+ 1 - 3
compiler/systems/t_sunos.pas

@@ -641,22 +641,20 @@ end;
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_solaris,TLinkerSolaris);
 {$ifdef i386}
-  RegisterExternalLinker(system_i386_solaris_info,TLinkersolaris);
   RegisterImport(system_i386_solaris,TImportLibsolaris);
   RegisterExport(system_i386_solaris,TExportLibsolaris);
   RegisterTarget(system_i386_solaris_info);
 {$endif i386}
 
 {$ifdef x86_64}
-  RegisterExternalLinker(system_x86_64_solaris_info,TLinkersolaris);
   RegisterImport(system_x86_64_solaris,TImportLibsolaris);
   RegisterExport(system_x86_64_solaris,TExportLibsolaris);
   RegisterTarget(system_x86_64_solaris_info);
 {$endif x86_64}
 
 {$ifdef sparc}
-  RegisterExternalLinker(system_sparc_solaris_info,TLinkersolaris);
   RegisterImport(system_sparc_solaris,TImportLibsolaris);
   RegisterExport(system_sparc_solaris,TExportLibsolaris);
   RegisterTarget(system_sparc_solaris_info);

+ 5 - 2
compiler/systems/t_symbian.pas

@@ -181,8 +181,11 @@ implementation
 *****************************************************************************}
 
 initialization
+  { Using external linker as internal doesn't look correct... }
+  RegisterLinker(ld_windows,TExternalLinkerWin);
+  RegisterLinker(ld_int_windows,TInternalLinkerWin);
 {$ifdef i386}
-  RegisterInternalLinker(system_i386_symbian_info,TExternalLinkerWin);
+  ///RegisterInternalLinker(system_i386_symbian_info,TExternalLinkerWin);
   RegisterImport(system_i386_symbian,TImportLibWin);
   RegisterExport(system_i386_symbian,TExportLibWin);
   RegisterDLLScanner(system_i386_symbian,TDLLScannerWin);
@@ -191,7 +194,7 @@ initialization
 {$endif i386}
 {$ifdef arm}
 //  RegisterExternalLinker(system_arm_symbian_info,TExternalLinkerWin);
-  RegisterInternalLinker(system_arm_symbian_info,TInternalLinkerWin);
+  ///RegisterInternalLinker(system_arm_symbian_info,TInternalLinkerWin);
   RegisterImport(system_arm_symbian,TImportLibWin);
   RegisterExport(system_arm_symbian,TExportLibWin);
   RegisterTarget(system_arm_symbian_info);

+ 1 - 1
compiler/systems/t_watcom.pas

@@ -174,6 +174,6 @@ end;}
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_i386_watcom_info,TLinkerWatcom);
+  RegisterLinker(ld_watcom,TLinkerWatcom);
   RegisterTarget(system_i386_watcom_info);
 end.

+ 1 - 1
compiler/systems/t_wdosx.pas

@@ -74,7 +74,7 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_i386_wdosx_info,TExternalLinkerWdosx);
+  RegisterLinker(ld_wdosx,TExternalLinkerWdosx);
   RegisterImport(system_i386_wdosx,TImportLibWdosx);
   RegisterExport(system_i386_wdosx,TExportLibWdosx);
   RegisterDLLScanner(system_i386_wdosx,TDLLScannerWdosx);

+ 1 - 1
compiler/systems/t_wii.pas

@@ -592,6 +592,6 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterExternalLinker(system_powerpc_wii_info,TLinkerWii);
+  RegisterLinker(ld_wii,TLinkerWii);
   RegisterTarget(system_powerpc_wii_info);
 end.

+ 2 - 8
compiler/systems/t_win.pas

@@ -1815,26 +1815,22 @@ implementation
 *****************************************************************************}
 
 initialization
+  RegisterLinker(ld_int_windows,TInternalLinkerWin);
+  RegisterLinker(ld_windows,TExternalLinkerWin);
 {$ifdef i386}
   { Win32 }
-  RegisterExternalLinker(system_i386_win32_info,TExternalLinkerWin);
-  RegisterInternalLinker(system_i386_win32_info,TInternalLinkerWin);
   RegisterImport(system_i386_win32,TImportLibWin);
   RegisterExport(system_i386_win32,TExportLibWin);
   RegisterDLLScanner(system_i386_win32,TDLLScannerWin);
   RegisterRes(res_gnu_windres_info,TWinLikeResourceFile);
   RegisterTarget(system_i386_win32_info);
   { WinCE }
-  RegisterExternalLinker(system_i386_wince_info,TExternalLinkerWin);
-  RegisterInternalLinker(system_i386_wince_info,TInternalLinkerWin);
   RegisterImport(system_i386_wince,TImportLibWin);
   RegisterExport(system_i386_wince,TExportLibWin);
   RegisterDLLScanner(system_i386_wince,TDLLScannerWin);
   RegisterTarget(system_i386_wince_info);
 {$endif i386}
 {$ifdef x86_64}
-  RegisterExternalLinker(system_x64_win64_info,TExternalLinkerWin);
-  RegisterInternalLinker(system_x64_win64_info,TInternalLinkerWin);
   RegisterImport(system_x86_64_win64,TImportLibWin);
   RegisterExport(system_x86_64_win64,TExportLibWin);
   RegisterDLLScanner(system_x86_64_win64,TDLLScannerWin);
@@ -1842,8 +1838,6 @@ initialization
   RegisterTarget(system_x64_win64_info);
 {$endif x86_64}
 {$ifdef arm}
-  RegisterExternalLinker(system_arm_wince_info,TExternalLinkerWin);
-  RegisterInternalLinker(system_arm_wince_info,TInternalLinkerWin);
   RegisterImport(system_arm_wince,TImportLibWin);
   RegisterExport(system_arm_wince,TExportLibWin);
   RegisterRes(res_gnu_windres_info,TWinLikeResourceFile);