Browse Source

+ started work on the Z80 internal linker

git-svn-id: trunk@45528 -
nickysn 5 năm trước cách đây
mục cha
commit
2353b1adee

+ 45 - 0
compiler/ogrel.pas

@@ -96,6 +96,22 @@ interface
         constructor create(info: pasminfo; smart:boolean);override;
         constructor create(info: pasminfo; smart:boolean);override;
       end;
       end;
 
 
+      { TRelObjInput }
+
+      TRelObjInput = class(TObjInput)
+      public
+        function ReadObjData(AReader:TObjectreader;out Data:TObjData):boolean;override;
+        class function CanReadObjData(AReader:TObjectreader):boolean;override;
+      end;
+
+      { TIntelHexExeOutput }
+
+      TIntelHexExeOutput = class(TExeOutput)
+      protected
+        function writeData:boolean;override;
+        procedure DoRelocationFixup(objsec:TObjSection);override;
+      end;
+
 implementation
 implementation
 
 
     uses
     uses
@@ -513,6 +529,35 @@ implementation
         CInternalAr:=tarobjectwriter;
         CInternalAr:=tarobjectwriter;
       end;
       end;
 
 
+
+{*****************************************************************************
+                                TRelObjInput
+*****************************************************************************}
+
+    function TRelObjInput.ReadObjData(AReader: TObjectreader; out Data: TObjData): boolean;
+      begin
+        result:=false;
+      end;
+
+    class function TRelObjInput.CanReadObjData(AReader: TObjectreader): boolean;
+      begin
+        result:=false;
+      end;
+
+
+{*****************************************************************************
+                             TIntelHexExeOutput
+*****************************************************************************}
+
+    function TIntelHexExeOutput.writeData: boolean;
+      begin
+        result:=false;
+      end;
+
+    procedure TIntelHexExeOutput.DoRelocationFixup(objsec: TObjSection);
+      begin
+      end;
+
 {*****************************************************************************
 {*****************************************************************************
                                   Initialize
                                   Initialize
 *****************************************************************************}
 *****************************************************************************}

+ 1 - 0
compiler/systems.inc

@@ -298,6 +298,7 @@
              ld_int_windows,
              ld_int_windows,
              ld_int_msdos,
              ld_int_msdos,
              ld_int_win16,
              ld_int_win16,
+             ld_int_zxspectrum,
              ld_freertos,
              ld_freertos,
              ld_zxspectrum
              ld_zxspectrum
        );
        );

+ 27 - 1
compiler/systems/t_zxspectrum.pas

@@ -33,7 +33,7 @@ implementation
        SysUtils,
        SysUtils,
        cutils,cfileutl,cclasses,
        cutils,cfileutl,cclasses,
        globtype,globals,systems,verbose,comphook,cscript,fmodule,i_zxspectrum,link,
        globtype,globals,systems,verbose,comphook,cscript,fmodule,i_zxspectrum,link,
-       cpuinfo;
+       cpuinfo,ogrel,owar;
 
 
     type
     type
 
 
@@ -58,6 +58,15 @@ implementation
           function postprocessexecutable(const fn : string;isdll:boolean): boolean;
           function postprocessexecutable(const fn : string;isdll:boolean): boolean;
        end;
        end;
 
 
+       { TInternalLinkerZXSpectrum }
+
+       TInternalLinkerZXSpectrum=class(tinternallinker)
+       protected
+         procedure DefaultLinkScript;override;
+       public
+         constructor create;override;
+       end;
+
 
 
 {*****************************************************************************
 {*****************************************************************************
                           TLinkerZXSpectrum
                           TLinkerZXSpectrum
@@ -309,12 +318,29 @@ function TLinkerZXSpectrum.postprocessexecutable(const fn: string; isdll: boolea
   end;
   end;
 
 
 
 
+{*****************************************************************************
+                          TInternalLinkerZXSpectrum
+*****************************************************************************}
+
+procedure TInternalLinkerZXSpectrum.DefaultLinkScript;
+  begin
+  end;
+
+constructor TInternalLinkerZXSpectrum.create;
+  begin
+    inherited create;
+    CArObjectReader:=TArObjectReader;
+    CExeOutput:=TIntelHexExeOutput;
+    CObjInput:=TRelObjInput;
+  end;
+
 {*****************************************************************************
 {*****************************************************************************
                                      Initialize
                                      Initialize
 *****************************************************************************}
 *****************************************************************************}
 
 
 initialization
 initialization
 {$ifdef z80}
 {$ifdef z80}
+  RegisterLinker(ld_int_zxspectrum,TInternalLinkerZXSpectrum);
   RegisterLinker(ld_zxspectrum,TLinkerZXSpectrum);
   RegisterLinker(ld_zxspectrum,TLinkerZXSpectrum);
   RegisterTarget(system_z80_zxspectrum_info);
   RegisterTarget(system_z80_zxspectrum_info);
 {$endif z80}
 {$endif z80}