Forráskód Böngészése

+ smartlinking works (only case jumptable left todo)
* redesign of systems.pas to support assemblers and linkers
+ Unitname is now also in the PPU-file, increased version to 14

peter 27 éve
szülő
commit
94b52a3d7f

+ 13 - 174
compiler/ag386int.pas

@@ -58,49 +58,6 @@ unit ag386int;
       if ref.isintvalue then
        s:= tostr(ref.offset)
       else
-{$ifdef ver0_6}
-       begin
-      first:=true;
-      { have we a segment prefix ? }
-      if ref.segment<>R_DEFAULT_SEG then
-      begin
-        if current_module^.output_format in [of_nasm,of_obj] then
-          s:='['+_reg2str[ref.segment]+':'
-        else
-          s:=_reg2str[ref.segment]+':[';
-      end
-      else s:='[';
-
-      if assigned(ref.symbol) then
-        begin
-           s:=s+ref.symbol^;
-           first:=false;
-        end;
-      if (ref.base<>R_NO) then
-        begin
-           if not(first) then
-             s:=s+'+'
-           else
-             first:=false;
-           s:=s+_reg2str[ref.base];
-        end;
-      if (ref.index<>R_NO) then
-        begin
-           if not(first) then
-             s:=s+'+'
-           else
-             first:=false;
-           s:=s+_reg2str[ref.index];
-           if ref.scalefactor<>0 then
-             s:=s+'*'+tostr(ref.scalefactor);
-        end;
-      if ref.offset<0 then
-        s:=s+tostr(ref.offset)
-      else if (ref.offset>0) then
-        s:=s+'+'+tostr(ref.offset);
-      s:=s+']';
-        end;
-{$else}
       with ref do
         begin
           first:=true;
@@ -143,7 +100,6 @@ unit ag386int;
            s:=s+'+'+tostr(offset);
          s:=s+']';
         end;
-{$endif}
        getreferencestring:=s;
      end;
 
@@ -322,12 +278,11 @@ unit ag386int;
       while assigned(hp) do
        begin
          case hp^.typ of
-           ait_comment :
-             Begin
-                AsmWrite(As_comment);
-                AsmWritePChar(pai_asm_comment(hp)^.str);
-                AsmLn;
-             End;
+       ait_comment : Begin
+                       AsmWrite(target_asm.comment);
+                       AsmWritePChar(pai_asm_comment(hp)^.str);
+                       AsmLn;
+                     End;
          ait_align : begin
                      { align not supported at all with nasm v095  }
                      { align with specific value not supported by }
@@ -440,7 +395,7 @@ unit ag386int;
                                       end;
                                end; { end for i:=0 to... }
                              if quoted then AsmWrite('"');
-                               AsmWrite(target_info.newline);
+                               AsmWrite(target_os.newline);
                              counter := counter+line_length;
                           end; { end for j:=0 ... }
                         { do last line of lines }
@@ -653,7 +608,7 @@ ait_stab_function_name : ;
       else
        begin
          AsmWriteLn(#9'.386p');
-         AsmWriteLn(#9'LOCALS '+target_info.labelprefix);
+         AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
 
          WriteTree(externals);
          { INTEL ASM doesn't support stabs
@@ -694,7 +649,12 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.5  1998-05-01 07:43:52  florian
+  Revision 1.6  1998-05-04 17:54:24  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.5  1998/05/01 07:43:52  florian
     + basics for rtti implemented
     + switch $m (generate rtti for published sections)
 
@@ -715,125 +675,4 @@ end.
 
   Revision 1.2  1998/04/08 11:34:17  peter
     * nasm works (linux only tested)
-
-  Revision 1.1.1.1  1998/03/25 11:18:16  root
-  * Restored version
-
-  Revision 1.1  1998/03/10 01:26:09  peter
-    + new uniform names
-
-  Revision 1.18  1998/03/09 12:58:11  peter
-    * FWait warning is only showed for Go32V2 and $E+
-    * opcode tables moved to i386.pas/m68k.pas to reduce circular uses (and
-      for m68k the same tables are removed)
-    + $E for i386
-
-  Revision 1.17  1998/03/06 00:52:23  peter
-    * replaced all old messages from errore.msg, only ExtDebug and some
-      Comment() calls are left
-    * fixed options.pas
-
-  Revision 1.16  1998/03/02 01:48:41  peter
-    * renamed target_DOS to target_GO32V1
-    + new verbose system, merged old errors and verbose units into one new
-      verbose.pas, so errors.pas is obsolete
-
-  Revision 1.15  1998/02/23 02:57:41  carl
-    * small bugfix when compiling $extdebug
-
-  Revision 1.14  1998/02/15 21:16:20  peter
-    * all assembler outputs supported by assemblerobject
-    * cleanup with assembleroutputs, better .ascii generation
-    * help_constructor/destructor are now added to the externals
-    - generation of asmresponse is not outputformat depended
-
-  Revision 1.13  1998/02/13 10:35:07  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
-  Revision 1.12  1998/02/12 17:19:07  florian
-    * fixed to get remake3 work, but needs additional fixes (output, I don't like
-      also that aktswitches isn't a pointer)
-
-  Revision 1.11  1998/02/12 11:50:11  daniel
-  Yes! Finally! After three retries, my patch!
-
-  Changes:
-
-  Complete rewrite of psub.pas.
-  Added support for DLL's.
-  Compiler requires less memory.
-  Platform units for each platform.
-
-  Revision 1.10  1997/12/13 18:59:48  florian
-  + I/O streams are now also declared as external, if neccessary
-  * -Aobj generates now a correct obj file via nasm
-
-  Revision 1.9  1997/12/12 13:28:26  florian
-  + version 0.99.0
-  * all WASM options changed into MASM
-  + -O2 for Pentium II optimizations
-
-  Revision 1.8  1997/12/09 13:45:10  carl
-  * bugfix of DT under nasm (not allowed if non integral - nasm v095)
-  + added pai_align --> useless here see file for more info
-  * bugfix of problems with in,out instructions under nasm
-  * bugfix of call under nasm (not fully tested though -- not sure)
-  * some range check errors removed (probably a few left though)
-  * bugfix of checking for extended type when emitting ':'
-
-  Revision 1.7  1997/12/04 15:20:47  carl
-  * esthetic bugfix with extdebug on.
-
-  Revision 1.6  1997/12/03 13:46:40  carl
-  * bugfix of my bug with near, now near in nasm mode for all non-rel8
-  instructions. (jcxz,jecxz still does not work thoug - assumed short now).
-
-  Revision 1.5  1997/12/02 15:52:26  carl
-  * bugfix of string (again...) - would be sometimes invalid.
-  * bugfix of segment overrides under nasm.
-  - removed near in labeled instructions (would cause errors).
-
-  Revision 1.4  1997/12/01 17:42:51  pierre
-     + added some more functionnality to the assembler parser
-
-  Revision 1.3  1997/11/28 18:14:36  pierre
-   working version with several bug fixes
-
-  Revision 1.2  1997/11/28 14:54:50  carl
-  + added popfd instruction.
-
-  Revision 1.1.1.1  1997/11/27 08:32:57  michael
-  FPC Compiler CVS start
-
-
-  Pre-CVS log:
-
-  CEC   Carl-Eric Codere
-  FK    Florian Klaempfl
-  PM    Pierre Muller
-  +     feature added
-  -     removed
-  *     bug fixed or changed
-
-  History:
-
-     9th october 1997:
-      * bugfix of string write, closing quotes would never be written. (CEC)
-    23 october 1997:
-      * fixed problem with writing strings of length = 0 (CEC).
-      + added line separation of long string chains. (CEC).
-    31st october 1997:
-      + completed the table of opcodes. (CEC)
-     3rd november 1997:
-      + MMX instructions added (FK)
-     9th november 1997:
-      * movsb represented the AT&T movsx - fixed, absolute values
-        in getreferencestring would be preceded by $ - fixed (CEC).
-
-  What's to do:
-    o Fix problems regarding the segment names under NASM
-    o generate extern entries for typed constants and variables
-    o write lines numbers and file names to output file
-    o comments
 }

+ 25 - 168
compiler/assemble.pas

@@ -33,23 +33,6 @@ const
 {$else}
   AsmOutSize=10000;
 {$endif}
-  SmartExt='.sl';
-
-{$ifdef i386}
-{ tof = (of_none,of_o,of_obj,of_masm,of_att,of_nasm,of_win32) }
-  AsBin : array[tof] of string[8]=('','as','nasm','tasm','as','nasm','asw');
-  { I hope that all I386 assembler recongnize this as
-    a comment begin (PM) }
-  As_comment : string[2] = '# ';
-{$endif}
-{$ifdef m68k}
-{ tof = (of_none,of_o,of_gas,of_mot,of_mit)  }
-  AsBin : array[tof] of string[8]=('','','as68k','','');
-  { I hope that all M68K assembler recongnize this as
-    a comment begin (PM) }
-  As_comment : string[2] = '| ';
-{$endif}
-
 
 type
   PAsmList=^TAsmList;
@@ -68,7 +51,7 @@ type
     outfile  : file;
     Constructor Init(const fn:string);
     Destructor Done;
-    Function  FindAssembler(curr_of:tof):string;
+    Function  FindAssembler:string;
     Function  CallAssembler(const command,para:string):Boolean;
     Function  DoAssemble:boolean;
     Procedure RemoveAsm;
@@ -116,17 +99,17 @@ end;
 *****************************************************************************}
 
 const
-  last_of  : tof=of_none;
+  lastas  : byte=255;
 var
   LastASBin : string;
-Function TAsmList.FindAssembler(curr_of:tof):string;
+Function TAsmList.FindAssembler:string;
 var
   asfound : boolean;
 begin
-  if last_of<>curr_of then
+  if lastas<>ord(target_asm.id) then
    begin
-     last_of:=curr_of;
-     LastASBin:=FindExe(asbin[curr_of],asfound);
+     lastas:=ord(target_asm.id);
+     LastASBin:=FindExe(target_asm.asmbin,asfound);
      if (not asfound) and (not externasm) then
       begin
         Message1(exec_w_assembler_not_found,LastASBin);
@@ -186,58 +169,19 @@ end;
 
 
 Function TAsmList.DoAssemble:boolean;
+var
+  s : string;
 begin
+  DoAssemble:=true;
   if DoPipe then
    exit;
   if not externasm then
    Message1(exec_i_assembling,asmfile);
-  case current_module^.output_format of
-{$ifdef i386}
-   of_att : begin
-              externasm:=true; {Force Extern Asm}
-              if CallAssembler(FindAssembler(of_att),' -D -o '+objfile+' '+AsmFile) then
-               RemoveAsm;
-            end;
-     of_o : begin
-              if CallAssembler(FindAssembler(of_o),'-D -o '+objfile+' '+AsmFile) then
-               RemoveAsm;
-            end;
- of_win32 : begin
-              if CallAssembler(FindAssembler(of_win32),'-D -o '+objfile+' '+AsmFile) then
-               RemoveAsm;
-            end;
-  of_nasm : begin
-            {$ifdef linux}
-              if CallAssembler(FindAssembler(of_nasm),' -f elf -o '+objfile+' '+AsmFile) then
-               RemoveAsm;
-            {$else}
-              if CallAssembler(FindAssembler(of_nasm),' -f coff -o '+objfile+' '+AsmFile) then
-               RemoveAsm;
-            {$endif}
-            end;
-   of_obj : begin
-              if CallAssembler(FindAssembler(of_nasm),' -f obj -o '+objfile+' '+AsmFile) then
-               RemoveAsm;
-            end;
-  of_masm : begin
-            { !! Nothing yet !! }
-            end;
-{$endif}
-{$ifdef m68k}
-   of_mot,
-   of_mit : begin
-            { !! Nothing yet !! }
-            end;
-   of_o,of_gas : begin
-              if CallAssembler(FindAssembler(of_gas),'  --register-prefix-optional'+
-              ' -o '+objfile+' '+asmfile) then
-               RemoveAsm;
-            end;
-{$endif}
-  else
-   internalerror(30000);
-  end;
-  DoAssemble:=true;
+  s:=target_asm.asmcmd;
+  Replace(s,'$ASM',AsmFile);
+  Replace(s,'$OBJ',ObjFile);
+  if CallAssembler(FindAssembler,s) then
+   RemoveAsm;
 end;
 
 
@@ -304,11 +248,11 @@ Procedure TAsmList.AsmLn;
 begin
   if OutCnt>=AsmOutSize-2 then
    AsmFlush;
-  OutBuf[OutCnt]:=target_info.newline[1];
+  OutBuf[OutCnt]:=target_os.newline[1];
   inc(OutCnt);
-  if length(target_info.newline)>1 then
+  if length(target_os.newline)>1 then
    begin
-     OutBuf[OutCnt]:=target_info.newline[2];
+     OutBuf[OutCnt]:=target_os.newline[2];
      inc(OutCnt);
    end;
 end;
@@ -395,7 +339,7 @@ begin
   smartcnt:=0;
   if smartlink then
    begin
-     path:=FixPath(path)+FixFileName(name+smartext);
+     path:=SmartLinkPath(name);
      {$I-}
       mkdir(path);
      {$I+}
@@ -448,24 +392,7 @@ Procedure OnlyAsm(const fn:string);
 var
   a : PAsmList;
 begin
-  case current_module^.output_format of
-{$ifdef i386}
-     of_o,
- of_win32,
-   of_att : a:=new(pi386attasmlist,Init(fn));
-   of_obj,
-  of_masm,
-  of_nasm : a:=new(pi386intasmlist,Init(fn));
-{$endif}
-{$ifdef m68k}
-     of_o,
-   of_gas : a:=new(pm68kgasasmlist,Init(fn));
-   of_mot : a:=new(pm68kmotasmlist,Init(fn));
-   of_mit : a:=new(pm68kmitasmlist,Init(fn));
-{$endif}
-  else
-   internalerror(30000);
-  end;
+  a:=new(pasmlist,Init(fn));
   a^.DoAssemble;
   dispose(a,Done);
 end;
@@ -473,7 +400,12 @@ end;
 end.
 {
   $Log$
-  Revision 1.5  1998-04-29 10:33:44  pierre
+  Revision 1.6  1998-05-04 17:54:24  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.5  1998/04/29 10:33:44  pierre
     + added some code for ansistring (not complete nor working yet)
     * corrected operator overloading
     * corrected nasm output
@@ -496,79 +428,4 @@ end.
 
   Revision 1.1.1.1  1998/03/25 11:18:16  root
   * Restored version
-
-  Revision 1.17  1998/03/10 13:23:00  florian
-    * small win32 problems fixed
-
-  Revision 1.16  1998/03/10 01:17:14  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.15  1998/03/09 10:37:41  peter
-    * fixed very long pchar writing (> outbufsize)
-
-  Revision 1.14  1998/03/05 22:43:45  florian
-    * some win32 support stuff added
-
-  Revision 1.13  1998/03/04 14:18:58  michael
-  * modified messaging system
-
-  Revision 1.12  1998/03/04 01:34:51  peter
-    * messages for unit-handling and assembler/linker
-    * the compiler compiles without -dGDB, but doesn't work yet
-    + -vh for Hint
-
-  Revision 1.11  1998/03/02 01:48:05  peter
-    * renamed target_DOS to target_GO32V1
-    + new verbose system, merged old errors and verbose units into one new
-      verbose.pas, so errors.pas is obsolete
-
-  Revision 1.10  1998/02/26 11:57:00  daniel
-  * New assembler optimizations commented out, because of bugs.
-  * Use of dir-/name- and extstr.
-
-  Revision 1.9  1998/02/24 10:29:12  peter
-    * -a works again
-
-  Revision 1.8  1998/02/21 03:31:40  carl
-    + mit68k asm support.
-
-  Revision 1.7  1998/02/18 14:18:16  michael
-  + added log at end of file (retroactively)
-
-  revision 1.6
-  date: 1998/02/18 13:43:11;  author: michael;  state: Exp;  lines: +3 -19
-  + Implemented an OS independent AsmRes object.
-  ----------------------------
-  revision 1.5
-  date: 1998/02/17 21:20:28;  author: peter;  state: Exp;  lines: +60 -54
-    + Script unit
-    + __EXIT is called again to exit a program
-    - target_info.link/assembler calls
-    * linking works again for dos
-    * optimized a few filehandling functions
-    * fixed stabs generation for procedures
-  ----------------------------
-  revision 1.4
-  date: 1998/02/16 12:51:27;  author: michael;  state: Exp;  lines: +2 -2
-  + Implemented linker object
-  ----------------------------
-  revision 1.3
-  date: 1998/02/15 21:15:58;  author: peter;  state: Exp;  lines: +8 -9
-    * all assembler outputs supported by assemblerobject
-    * cleanup with assembleroutputs, better .ascii generation
-    * help_constructor/destructor are now added to the externals
-    - generation of asmresponse is not outputformat depended
-  ----------------------------
-  revision 1.2
-  date: 1998/02/14 01:45:04;  author: peter;  state: Exp;  lines: +3 -14
-    * more fixes
-    - pmode target is removed
-    - search_as_ld is removed, this is done in the link.pas/assemble.pas
-    + findexe() to search for an executable (linker,assembler,binder)
-  ----------------------------
-  revision 1.1
-  date: 1998/02/13 22:28:16;  author: peter;  state: Exp;
-    + Initial implementation
 }

+ 50 - 225
compiler/files.pas

@@ -101,7 +101,8 @@ unit files;
           imports       : plinkedlist;
 
           sourcefiles   : tfilemanager;
-          linklibfiles,
+          linksharedlibs,
+          linkstaticlibs,
           linkofiles    : tstringcontainer;
           used_units    : tlinkedlist;
           current_inputfile : pinputfile;
@@ -142,7 +143,7 @@ unit files;
                                    { signature    |          |       }
                                    {  |           |          |       }
                                    { /-------\   /-------\  /----\   }
-       unitheader : tunitheader  = ('P','P','U','0','1','3',#0,#99,
+       unitheader : tunitheader  = ('P','P','U','0','1','4',#0,#99,
                                      #0,#0,#0,#0,#0,#0,#255,#255,
                                    { |   | \---------/ \-------/    }
                                    { |   |    |             |        }
@@ -184,11 +185,12 @@ unit files;
        ibabsolutesym   = 28;
        ibclassrefdef   = 29;
        ibpropertysym   = 30;
-       iblibraries     = 31;
+       ibsharedlibs    = 31;
        iblongstringdef = 32;
        ibansistringdef = 33;
        ibunitname      = 34;
        ibwidestringdef = 35;
+       ibstaticlibs    = 36;
        ibend           = 255;
 
        { unit flags }
@@ -328,7 +330,7 @@ unit files;
          objfilename:=stringdup(s+target_info.objext);
          asmfilename:=stringdup(s+target_info.asmext);
          ppufilename:=stringdup(s+target_info.unitext);
-         arfilename:=stringdup(s+target_info.arext);
+         arfilename:=stringdup(s+target_os.staticlibext);
       end;
 
     function tmodule.load_ppu(const unit_path,n,ext : string):boolean;
@@ -395,7 +397,6 @@ unit files;
 
     { read name if its there }
       ppufile^.read_data(b,1,count);
-{$IFDEF UNITNAME}
       if b=ibunitname then
        begin
          ppufile^.read_data(hs[0],1,count);
@@ -404,7 +405,6 @@ unit files;
          unitname:=stringdup(hs);
          ppufile^.read_data(b,1,count);
        end;
-{$ENDIF UNITNAME}
 
     { search source files there is at least one source file }
       do_compile:=false;
@@ -451,23 +451,32 @@ unit files;
       mainsource:=stringdup(ppufile^.path^+hs);
 
     { check the object and assembler file if not a library }
-      if (flags and uf_in_library)=0 then
+      if (flags and uf_smartlink)<>0 then
        begin
-       { the objectfile should be newer than the ppu file }
-         objfiletime:=getnamedfiletime(objfilename^);
+         objfiletime:=getnamedfiletime(arfilename^);
          if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
+           do_compile:=true;
+       end
+      else
+       begin
+         if (flags and uf_in_library)=0 then
           begin
-          { check if assembler file is older than ppu file }
-            asmfileTime:=GetNamedFileTime(asmfilename^);
-            if (asmfiletime<0) or (ppufiletime>asmfiletime) then
-             begin
-               Message(unit_d_obj_and_asm_are_older_than_ppu);
-               do_compile:=true;
-             end
-            else
+          { the objectfile should be newer than the ppu file }
+            objfiletime:=getnamedfiletime(objfilename^);
+            if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
              begin
-               Message(unit_d_obj_is_older_than_asm);
-               do_assemble:=true;
+             { check if assembler file is older than ppu file }
+               asmfileTime:=GetNamedFileTime(asmfilename^);
+               if (asmfiletime<0) or (ppufiletime>asmfiletime) then
+                begin
+                  Message(unit_d_obj_and_asm_are_older_than_ppu);
+                  do_compile:=true;
+                end
+               else
+                begin
+                  Message(unit_d_obj_is_older_than_asm);
+                  do_assemble:=true;
+                end;
              end;
           end;
        end;
@@ -504,11 +513,11 @@ unit files;
          { Check for PPL file }
            if not (cs_link_static in aktswitches) then
             begin
-              Found:=UnitExists(target_info.libext);
+              Found:=UnitExists(target_info.unitlibext);
               if Found then
                Begin
                  SetFileName(SinglePathString,FileName);
-                 Found:=Load_PPU(singlepathstring,filename,target_info.libext);
+                 Found:=Load_PPU(singlepathstring,filename,target_info.unitlibext);
                End;
              end;
          { Check for PPU file }
@@ -527,22 +536,22 @@ unit files;
               ppufile:=nil;
               do_compile:=true;
             {Check for .pp file}
-              Found:=UnitExists(target_info.sourceext);
+              Found:=UnitExists(target_os.sourceext);
               if Found then
-               Ext:=target_info.sourceext
+               Ext:=target_os.sourceext
               else
                begin
                {Check for .pas}
-                 Found:=UnitExists(target_info.pasext);
+                 Found:=UnitExists(target_os.pasext);
                  if Found then
-                  Ext:=target_info.pasext;
+                  Ext:=target_os.pasext;
                end;
               stringdispose(mainsource);
               if Found then
                begin
                  sources_avail:=true;
                {Load Filenames when found}
-	         mainsource:=StringDup(SinglePathString+FileName+Ext);
+                 mainsource:=StringDup(SinglePathString+FileName+Ext);
                  SetFileName(SinglePathString,FileName);
                end
               else
@@ -569,12 +578,14 @@ unit files;
          used_units.init;
          sourcefiles.init;
          linkofiles.init;
-         linklibfiles.init;
+         linkstaticlibs.init;
+         linksharedlibs.init;
          ppufile:=nil;
          current_inputfile:=nil;
          map:=nil;
          symtable:=nil;
          flags:=0;
+         crc:=0;
          unitcount:=1;
          do_assemble:=false;
          do_compile:=false;
@@ -585,6 +596,9 @@ unit files;
          uses_imports:=false;
          imports:=new(plinkedlist,init);
          output_format:=commandline_output_format;
+       { set smartlink flag }
+         if smartlink then
+          flags:=flags or uf_smartlink;
        { search the PPU file if it is an unit }
          if is_unit then
           search_unit(unitname^);
@@ -600,11 +614,12 @@ unit files;
          used_units.done; }
          sourcefiles.done;
          linkofiles.done;
-         linklibfiles.done;
+         linkstaticlibs.done;
+         linksharedlibs.done;
          if assigned(ppufile) then
           dispose(ppufile,done);
          if assigned(imports) then
-           dispose(imports,done);
+          dispose(imports,done);
          inherited done;
       end;
 
@@ -631,7 +646,12 @@ unit files;
 end.
 {
   $Log$
-  Revision 1.7  1998-05-01 16:38:44  florian
+  Revision 1.8  1998-05-04 17:54:25  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.7  1998/05/01 16:38:44  florian
     * handling of private and protected fixed
     + change_keywords_to_tp implemented to remove
       keywords which aren't supported by tp
@@ -666,199 +686,4 @@ end.
   Revision 1.2  1998/04/21 10:16:47  peter
     * patches from strasbourg
     * objects is not used anymore in the fpc compiled version
-
-  Revision 1.1.1.1  1998/03/25 11:18:12  root
-  * Restored version
-
-  Revision 1.37  1998/03/13 22:45:58  florian
-    * small bug fixes applied
-
-  Revision 1.36  1998/03/11 22:22:52  florian
-    * Fixed circular unit uses, when the units are not in the current dir (from Peter)
-    * -i shows correct info, not <lf> anymore (from Peter)
-    * linking with shared libs works again (from Peter)
-
-  Revision 1.35  1998/03/10 16:27:38  pierre
-    * better line info in stabs debug
-    * symtabletype and lexlevel separated into two fields of tsymtable
-    + ifdef MAKELIB for direct library output, not complete
-    + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
-      working
-    + ifdef TESTFUNCRET for setting func result in underfunction, not
-      working
-
-  Revision 1.34  1998/03/10 01:17:18  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.33  1998/03/04 17:33:44  michael
-  + Changed ifdef FPK to ifdef FPC
-
-  Revision 1.32  1998/03/04 01:35:03  peter
-    * messages for unit-handling and assembler/linker
-    * the compiler compiles without -dGDB, but doesn't work yet
-    + -vh for Hint
-
-  Revision 1.31  1998/02/28 14:43:47  florian
-    * final implemenation of win32 imports
-    * extended tai_align to allow 8 and 16 byte aligns
-
-  Revision 1.30  1998/02/28 09:30:57  florian
-    + writing of win32 import section added
-
-  Revision 1.29  1998/02/28 00:20:23  florian
-    * more changes to get import libs for Win32 working
-
-  Revision 1.28  1998/02/26 11:57:06  daniel
-  * New assembler optimizations commented out, because of bugs.
-  * Use of dir-/name- and extstr.
-
-  Revision 1.27  1998/02/24 14:20:51  peter
-    + tstringcontainer.empty
-    * ld -T option restored for linux
-    * libraries are placed before the objectfiles in a .PPU file
-    * removed 'uses link' from files.pas
-
-  Revision 1.26  1998/02/24 10:29:13  peter
-    * -a works again
-
-  Revision 1.25  1998/02/24 00:19:09  peter
-    * makefile works again (btw. linux does like any char after a \ )
-    * removed circular unit with assemble and files
-    * fixed a sigsegv in pexpr
-    * pmodule init unit/program is the almost the same, merged them
-
-  Revision 1.24  1998/02/22 23:03:17  peter
-    * renamed msource->mainsource and name->unitname
-    * optimized filename handling, filename is not seperate anymore with
-      path+name+ext, this saves stackspace and a lot of fsplit()'s
-    * recompiling of some units in libraries fixed
-    * shared libraries are working again
-    + $LINKLIB <lib> to support automatic linking to libraries
-    + libraries are saved/read from the ppufile, also allows more libraries
-      per ppufile
-
-  Revision 1.23  1998/02/17 21:20:48  peter
-    + Script unit
-    + __EXIT is called again to exit a program
-    - target_info.link/assembler calls
-    * linking works again for dos
-    * optimized a few filehandling functions
-    * fixed stabs generation for procedures
-
-  Revision 1.22  1998/02/16 12:51:30  michael
-  + Implemented linker object
-
-  Revision 1.21  1998/02/13 10:34:58  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
-  Revision 1.20  1998/02/12 11:50:04  daniel
-  Yes! Finally! After three retries, my patch!
-
-  Changes:
-
-  Complete rewrite of psub.pas.
-  Added support for DLL's.
-  Compiler requires less memory.
-  Platform units for each platform.
-
-  Revision 1.19  1998/02/06 23:08:33  florian
-    + endian to targetinfo and sourceinfo added
-    + endian independed writing of ppu file (reading missed), a PPU file
-      is written with the target endian
-
-  Revision 1.18  1998/02/02 13:13:27  pierre
-    * line_count transfered to tinputfile, to avoid crosscounting
-
-  Revision 1.17  1998/01/30 17:31:20  pierre
-    * bug of cyclic symtablestack fixed
-
-  Revision 1.16  1998/01/26 18:51:18  peter
-    * ForceSlash() changed to FixPath() which also removes a trailing './'
-
-  Revision 1.15  1998/01/23 17:12:11  pierre
-    * added some improvements for as and ld :
-      - doserror and dosexitcode treated separately
-      - PATH searched if doserror=2
-    + start of long and ansi string (far from complete)
-      in conditionnal UseLongString and UseAnsiString
-    * options.pas cleaned (some variables shifted to globals)gl
-
-  Revision 1.14  1998/01/22 08:57:54  peter
-    + added target_info.pasext and target_info.libext
-
-  Revision 1.13  1998/01/21 00:11:35  peter
-    * files in a ppl will now not recompile
-    * better info about source files of a ppu, a * after the time will
-      indicate that the file is changed
-
-  Revision 1.12  1998/01/20 13:16:29  michael
-  + Added flag for static/shared libs.
-
-  Revision 1.11  1998/01/17 01:57:32  michael
-  + Start of shared library support. First working version.
-
-  Revision 1.10  1998/01/16 12:52:09  michael
-  + Path treatment and file searching should now be more or less in their
-    definite form:
-    - Using now modified AddPathToList everywhere.
-    - File Searching mechanism is uniform for all files.
-    - Include path is working now !!
-    All fixes by Peter Vreman. Tested with remake3 target.
-
-  Revision 1.9  1998/01/16 00:00:54  michael
-  + Better and more modular searching and loading of units.
-    - searching in tmodule.search_unit.
-    - initial Loading in tmpodule.load_ppu.
-    - tmodule.init now calls search_unit.
-  * Case sensitivity problem of unix hopefully solved now forever.
-    (All from Peter Vreman, checked with remake3)
-
-  Revision 1.8  1998/01/15 13:07:46  michael
-  + added library treating stuff
-
-  Revision 1.7  1998/01/15 12:01:19  michael
-  * Linux prints now that actual name of the file being loaded.
-
-  Revision 1.6  1998/01/13 23:39:26  michael
-  * changed mechanism to look for unit file.
-  + added iblibraries constant to implement shared libraries.
-
-  Revision 1.5  1998/01/13 23:05:51  florian
-    + unit format 013 (change of options size, see symtable.pas log)
-
-  Revision 1.4  1998/01/13 17:13:06  michael
-  * File time handling and file searching is now done in an OS-independent way,
-    using the new file treating functions in globals.pas.
-
-  Revision 1.3  1998/01/07 00:16:49  michael
-  Restored released version (plus fixes) as current
-
-  Revision 1.2  1997/11/28 18:14:31  pierre
-   working version with several bug fixes
-
-  Revision 1.1.1.1  1997/11/27 08:32:56  michael
-  FPC Compiler CVS start
-
-
-  Pre-CVS log:
-
-  CEC  Carl-Eric Codere
-  FK   Florian Klaempfl
-  +    feature added
-  -    removed
-  *    bug fixed or changed
-
-  History (started with version 0.9.0):
-       2th december 1996:
-         + unit started  (FK)
-      22th december 1996:
-         + tinputfile added  (FK)
-      7th september 1997:
-         + moved main_module and current_module to const section
-           line ~319 and ~416: in_main initialized - added in_main
-           field to tmodule object  (CEC)
-
 }

+ 8 - 126
compiler/i386.pas

@@ -1107,11 +1107,11 @@ unit i386;
            lab2str:='ILLEGAL'
          else
          begin
-            lab2str:=target_info.labelprefix+tostr(l^.nb);
+            lab2str:=target_asm.labelprefix+tostr(l^.nb);
          end;
 {$else EXTDEBUG}
            internalerror(2000);
-           lab2str:=target_info.labelprefix+tostr(l^.nb);
+           lab2str:=target_asm.labelprefix+tostr(l^.nb);
 {$endif EXTDEBUG}
          { was missed: }
          inc(l^.refcount);
@@ -1780,7 +1780,12 @@ unit i386;
 end.
 {
   $Log$
-  Revision 1.5  1998-04-29 10:33:53  pierre
+  Revision 1.6  1998-05-04 17:54:25  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.5  1998/04/29 10:33:53  pierre
     + added some code for ansistring (not complete nor working yet)
     * corrected operator overloading
     * corrected nasm output
@@ -1802,127 +1807,4 @@ end.
     * bugfix of crash with ins_cache and popfd
     * bugfix of pushfd typo mistake in att output
     + added setc, and setnc
-
-  Revision 1.1.1.1  1998/03/25 11:18:13  root
-  * Restored version
-
-  Revision 1.21  1998/03/10 16:27:39  pierre
-    * better line info in stabs debug
-    * symtabletype and lexlevel separated into two fields of tsymtable
-    + ifdef MAKELIB for direct library output, not complete
-    + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
-      working
-    + ifdef TESTFUNCRET for setting func result in underfunction, not
-      working
-
-  Revision 1.20  1998/03/10 01:17:19  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.19  1998/03/09 12:58:11  peter
-    * FWait warning is only showed for Go32V2 and $E+
-    * opcode tables moved to i386.pas/m68k.pas to reduce circular uses (and
-      for m68k the same tables are removed)
-    + $E for i386
-
-  Revision 1.18  1998/03/06 00:52:19  peter
-    * replaced all old messages from errore.msg, only ExtDebug and some
-      Comment() calls are left
-    * fixed options.pas
-
-  Revision 1.17  1998/03/02 01:48:38  peter
-    * renamed target_DOS to target_GO32V1
-    + new verbose system, merged old errors and verbose units into one new
-      verbose.pas, so errors.pas is obsolete
-
-  Revision 1.16  1998/02/28 00:20:25  florian
-    * more changes to get import libs for Win32 working
-
-  Revision 1.15  1998/02/25 12:32:16  daniel
-  * Compiler uses even less memory.
-
-  Revision 1.14  1998/02/13 10:35:06  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
-  Revision 1.13  1998/02/12 17:19:04  florian
-    * fixed to get remake3 work, but needs additional fixes (output, I don't like
-      also that aktswitches isn't a pointer)
-
-  Revision 1.12  1998/02/12 11:50:08  daniel
-  Yes! Finally! After three retries, my patch!
-
-  Changes:
-
-  Complete rewrite of psub.pas.
-  Added support for DLL's.
-  Compiler requires less memory.
-  Platform units for each platform.
-
-  Revision 1.11  1998/02/04 22:01:59  florian
-    + S_D for MMX MOVD added, but unused
-
-  Revision 1.10  1998/01/16 22:34:33  michael
-  * Changed 'conversation' to 'conversion'. Waayyy too much chatting going on
-    in this compiler :)
-
-  Revision 1.9  1997/12/13 18:59:46  florian
-  + I/O streams are now also declared as external, if neccessary
-  * -Aobj generates now a correct obj file via nasm
-
-  Revision 1.8  1997/12/09 13:42:09  carl
-  * bugfix of lab2str with nasm output
-    (. = local label in nasm, which would cause some problems sometimes)
-  * bugfix of out reg,imm8 (missing instruction template)
-  + renamed pai_labeled386 --> pai_labeled
-  + added extended size constant
-
-  Revision 1.7  1997/12/08 11:43:43  pierre
-     * syntax error in previous commit
-
-  Revision 1.6  1997/12/08 10:12:05  pierre
-     * bug fix for cmpb for a value in the range 129-255 :
-       if the destination is a word or lognint reg then there is an implicit sign
-       extension of the const (thus becoming -127 to -1)
-     + redefined ao_floatreg to include the floatacc (used in ratti386.pas)
-
-  Revision 1.5  1997/11/28 23:46:09  florian
-  LOC_CMMXREGISTER added
-
-  Revision 1.4  1997/11/28 19:56:41  carl
-  * forgot dtou!
-
-  Revision 1.3  1997/11/28 18:15  pierre
-   working version with several bug fixes
-
-  Revision 1.2  1997/11/28 14:53:38  carl
-  + added popad,popfd,pushad,pushfd in op table.
-
-  Revision 1.1.1.1  1997/11/27 08:32:56  michael
-  FPC Compiler CVS start
-
-  Pre-CVS log:
-
-  FK     Florian Klaempfl
-  PM     Pierre Muller
-  +      feature added
-  -      removed
-  *      bug fixed or changed
-
-  History:
-      30th september 1996:
-         + unit started
-      15th october 1996:
-         + tai386 added
-         + some code from asmgen moved to this unit
-      26th november 1996:
-         + tai386_labeled
-      15th october 1997:
-         + lab2str increments also refcount (FK)
-      6th november 1997:
-         * added S_T for s80real fldt and fstpt (PM)
-      20th november 1997:
-         * changed LOC_FPUSTACK to LOC_FPU for compatibility with m68k (PM)
-
 }

+ 206 - 302
compiler/link.pas

@@ -25,73 +25,111 @@ Unit link;
 
 Interface
 
-uses cobjects;
-
-Type TLinker = Object
-     { Internal variables. Don't access directly }
-       {$ifdef linux}
-       LinkToC : Boolean;                 { Should we link to the C libs? }
-       GccLibraryPath : String;           { Where is GCCLIB ? }
-       DynamicLinker : String;            { What Dynamic linker ? }
-       {$endif}
-       OFiles, LibFiles : TStringContainer;
-       Strip : Boolean;                   { Strip symbols ? }
-       MakeLib : Boolean;                 { If unit : Make library ?}
+uses cobjects,dos;
+
+Type
+    TLinker = Object
+       LinkToC,                           { Should we link to the C libs? }
+       Strip             : Boolean;       { Strip symbols ? }
+       ObjectFiles,
+       SharedLibFiles,
+       StaticLibFiles    : TStringContainer;
        ExeName,                           { FileName of the exe to be created }
-       LibName     : String;              { FileName of the lib to be created }
-       LinkResName : String[32];          { Name of response file }
-       LinkOptions : String;              { Additional options to the linker }
-       LibrarySearchPath : String;        { Where to look for libraries }
+       SharedLibName,
+       StaticLibName,                     { FileName of the lib to be created }
+       LinkOptions       : string;        { Additional options to the linker }
+       DynamicLinker     : String[80];    { What Dynamic linker ? }
+       LinkResName       : String[32];    { Name of response file }
      { Methods }
        Constructor Init;
-       Procedure SetFileName(const s:string);
+       Destructor Done;
+       Procedure SetExeName(const s:string);
+       Procedure SetLibName(const s:string);
        function  FindObjectFile(s : string) : string;
-       Procedure AddLibraryFile(S : String);
-       Procedure AddObjectFile(S : String);
-       Function  FindLinker : String;      { Find linker, sets Name }
-       Function  DoExec(const command,para:string):boolean;
-       Function  WriteResponseFile : Boolean;
-       Function  Link:boolean;
-       Procedure Make_Library;
+       function  FindLibraryFile(s:string;const ext:string) : string;
+       Procedure AddObject(const S : String);
+       Procedure AddStaticLibrary(const S : String);
+       Procedure AddSharedLibrary(const S : String);
+       Function  FindLinker:String;      { Find linker, sets Name }
+       Function  DoExec(const command,para:string;info:boolean):boolean;
+       Function  WriteResponseFile:Boolean;
+       Function  MakeExecutable:boolean;
+       Procedure MakeStaticLibrary(const path:string);
+       Procedure MakeSharedLibrary;
      end;
      PLinker=^TLinker;
 
-Var Linker : TLinker;
+Var
+  Linker : TLinker;
 
 
 Implementation
 
 uses
-  Script,globals,systems,dos,verbose;
+  Script,globals,systems,linux,dos,verbose;
+
+{$ifndef linux}
+Procedure Shell(command:string);
+{ This is already defined in the linux.ppu for linux, need for the *
+  expansion under linux }
+begin
+  shell:=getenv('COMSPEC');
+  Exec(shell,command);
+end;
+{$endif}
+
+
 
 Constructor TLinker.Init;
 begin
-  OFiles.Init;
-  LibFiles.Init;
-  OFiles.Doubles:=False;
-  LibFiles.Doubles:=False;
+  ObjectFiles.Init;
+  SharedLibFiles.Init;
+  StaticLibFiles.Init;
+  ObjectFiles.Doubles:=False;
+  SharedLibFiles.Doubles:=False;
+  StaticLibFiles.Doubles:=False;
+  LinkToC:=False;
   Strip:=false;
   LinkOptions:='';
-  LinkResName:='link.res';
   ExeName:='';
-  LibName:='';
-{$ifdef linux}
-  LinkToC:=False;
+  SharedLibName:='';
+  StaticLibName:='';
   LibrarySearchPath:='';
+  ObjectSearchPath:='';
+{$ifdef linux}
   DynamicLinker:='/lib/ld-linux.so.1';
+{$else}
+  DynamicLinker:='';
 {$endif}
+  LinkResName:='link.res';
+end;
+
+
+Destructor TLinker.Done;
+begin
+end;
+
+
+Procedure TLinker.SetExeName(const s:string);
+var
+  path : dirstr;
+  name : namestr;
+  ext  : extstr;
+begin
+  FSplit(s,path,name,ext);
+  ExeName:=Path+Name+target_os.ExeExt;
 end;
 
 
-Procedure TLinker.SetFileName(const s:string);
+Procedure TLinker.SetLibName(const s:string);
 var
-  path:dirstr;
-  name:namestr;
-  ext:extstr;
+  path : dirstr;
+  name : namestr;
+  ext  : extstr;
 begin
   FSplit(s,path,name,ext);
-  LibName:=Path+Name+target_info.DllExt;
-  ExeName:=Path+Name+target_info.ExeExt;
+  SharedLibName:=Path+Name+target_os.SharedLibExt;
+  StaticLibName:=Path+Name+target_os.StaticLibExt;
 end;
 
 
@@ -103,13 +141,7 @@ var
 begin
   if LastLDBin='' then
    begin
-     if (target_info.target=target_WIN32) then
-     { the win32 linker has another name to allow cross compiling between }
-     { DOS and Win32, I think it should be possible to compile an ld      }
-     { with handles coff and pe, but I don't know how      (FK)           }
-       LastLDBin:=FindExe('ldw',ldfound)
-     else
-       LastLDBin:=FindExe('ld',ldfound);
+     LastLDBin:=FindExe(target_link.linkbin,ldfound);
      if (not ldfound) and (not externlink) then
       begin
         Message1(exec_w_linker_not_found,LastLDBin);
@@ -136,35 +168,56 @@ begin
      exit;
    end;
   findobjectfile:=search(s,'.;'+unitsearchpath+';'+exepath,found)+s;
-  if (not externasm) and (not found) then
-   Message1(exec_e_objfile_not_found,s);
+  if (not externlink) and (not found) then
+   Message1(exec_w_objfile_not_found,s);
 end;
 
 
-Procedure TLInker.AddObjectFile (S : String);
+{ searches an library file }
+function TLinker.FindLibraryFile(s:string;const ext:string) : string;
+var
+  found : boolean;
 begin
   if pos('.',s)=0 then
-   s:=s+target_info.objext;
+   s:=s+ext;
   s:=FixFileName(s);
-  OFiles.Insert (S);
+  if FileExists(s) then
+   begin
+     FindLibraryFile:=s;
+     exit;
+   end;
+  findlibraryfile:=search(s,'.;'+librarysearchpath+';'+exepath,found)+s;
+  if (not externlink) and (not found) then
+   Message1(exec_w_libfile_not_found,s);
 end;
 
 
-Procedure TLInker.AddLibraryFile(S:String);
+Procedure TLinker.AddObject(const S : String);
 begin
-  if pos('.',s)=0 then
-   s:=s+target_info.dllext;
-  LibFiles.Insert (S);
+  ObjectFiles.Insert(FindObjectFile(s));
+end;
+
+
+Procedure TLinker.AddSharedLibrary(const S:String);
+begin
+  SharedLibFiles.Insert (S);
+{ SharedLibFiles.Insert(FindLibraryFile(s,target_os.sharedlibext)); }
+end;
+
+
+Procedure TLinker.AddStaticLibrary(const S:String);
+begin
+  StaticLibFiles.Insert(FindLibraryFile(s,target_os.staticlibext));
 end;
 
 
-Function TLinker.DoExec(const command,para:string):boolean;
+Function TLinker.DoExec(const command,para:string;info:boolean):boolean;
 begin
   DoExec:=true;
   if not externlink then
    begin
      swapvectors;
-     exec(command,para);
+     shell(command+' '+para);
      swapvectors;
      if (dosexitcode<>0) then
       begin
@@ -180,7 +233,12 @@ begin
        end;
    end;
   if externlink then
-   AsmRes.AddLinkCommand (Command,Para,ExeName);
+   begin
+     if info then
+      AsmRes.AddLinkCommand(Command,Para,ExeName)
+     else
+      AsmRes.AddLinkCommand(Command,Para,'');
+   end;
 end;
 
 
@@ -194,56 +252,55 @@ begin
   assign(linkresponse,inputdir+LinkResName);
   rewrite(linkresponse);
 
-{ Write Header and set runtime object (prt0) }
+{ set special options for some targets }
+  prtobj:='prt0';
   case target_info.target of
-   target_WIN32 : begin
-                    prtobj:='';
-                    writeln(linkresponse,'INPUT (');
-                  end;
+   target_Win32 : prtobj:='';
    target_linux : begin
                     if cs_profile in aktswitches then
-                     prtobj:='gprt0'
-                    else
-                     prtobj:='prt0';
-{$ifdef Linux}
-                    if LinkToC then
-                     writeln(linkresponse,'SEARCH_DIR ('+GCCLibraryPath +')');
-{$endif}
-                    writeln(linkresponse,'INPUT (');
+                     begin
+                       prtobj:='gprt0';
+                       AddSharedLibrary('gmon');
+                       AddSharedLibrary('c');
+                     end;
                   end;
-  else
-   prtobj:='prt0';
-  end;          
+  end;
+
+  writeln(linkresponse,target_link.inputstart);
 
 { add objectfiles, start with prt0 always }
   if prtobj<>'' then
    Writeln(linkresponse,FindObjectFile(prtobj));
-  while not OFiles.Empty do
+  while not ObjectFiles.Empty do
    begin
-     s:=Findobjectfile(OFiles.Get);
+     s:=ObjectFiles.Get;
      if s<>'' then
       Writeln(linkresponse,s);
    end;
 
-{ Write libraries like -l<lib> }
-  While not LibFiles.Empty do
+{ Write sharedlibraries like -l<lib> }
+  While not SharedLibFiles.Empty do
    begin
-     S:=LibFiles.Get;
-     i:=Pos(target_info.dllext,S);
+     S:=SharedLibFiles.Get;
+     i:=Pos(target_os.sharedlibext,S);
      if i>0 then
       Delete(S,i,255);
-   {OS/2 linker supports -l, but not for import libraries.
-    For now, this fix should do it, as we don't support other libraries yet
-    but we need to think of something better.}
-   if target_info.target=target_OS2 then
-     writeln(linkresponse,s)
-   else
-     Writeln (LinkResponse,'-l'+S);
+     writeln(linkresponse,target_link.libprefix+s);
    end;
 
-{ Write End of response file }
-  if target_info.target in [target_WIN32,target_linux] then
-    Writeln (LinkResponse,')');
+  writeln(linkresponse,target_link.inputend);
+
+{ Write staticlibraries }
+  if not StaticLibFiles.Empty then
+   begin
+     Writeln(LinkResponse,target_link.GroupStart);
+     While not StaticLibFiles.Empty do
+      begin
+        S:=StaticLibFiles.Get;
+        writeln(linkresponse,s)
+      end;
+     Writeln(LinkResponse,target_link.GroupEnd);
+   end;
 
 { Close response }
   close(linkresponse);
@@ -251,64 +308,43 @@ begin
 end;
 
 
-Function TLinker.link:boolean;
+Function TLinker.MakeExecutable:boolean;
 var
   bindbin    : string[80];
   bindfound  : boolean;
   _stacksize,i,
   _heapsize  : longint;
-  s,s2       : string[10];
+  s,s2       : string;
   dummy      : file;
   success    : boolean;
 begin
 {$ifdef linux}
   if LinkToC then
    begin
-     AddObjectFile('/usr/lib/crt0.o');
-     AddObjectFile(FindObjectFile('lprt'));
-     AddLibraryFile('libc.a');
-     AddLibraryFile('libgcc.a');
+     AddObject('/usr/lib/crt0.o');
+     AddObject('lprt');
+     AddStaticLibrary('libc.a');
+     AddStaticLibrary('libgcc.a');
    end;
 {$endif Linux}
 
-{ Create Linkoptions }
-  case target_info.target of
-     target_GO32V1:
-       LinkOptions:=LinkOptions+' -oformat coff-go32';
-     target_GO32V2:
-       LinkOptions:=LinkOptions+' -oformat coff-go32-exe';
-      target_linux: begin
-                      if cs_profile in aktswitches then
-                       begin
-                         AddLibraryFile('gmon');
-                         AddLibraryFile('c');
-                       end;     
-                    end;
-  end;
-
-{$ifdef linux}
-  If not LibFiles.Empty then
+  If not SharedLibFiles.Empty then
    LinkOptions:='-dynamic-linker='+DynamicLinker+' '+LinkOptions;
-{$endif linux}
-
   if Strip then
-   LinkOptions:=LinkOptions+' -s';
-
+   LinkOptions:=LinkOptions+target_link.stripopt;
+   
 { Write used files and libraries }
   WriteResponseFile;
-
+  
 { Call linker }
   if not externlink then
    Message1(exec_i_linking,ExeName);
-{$ifdef linux}
-  success:=DoExec(FindLinker,LinkOptions+' -o '+exename+' '+inputdir+LinkResName);
-{$else}
-  if target_info.target=target_WIN32 then
-    success:=DoExec(FindLinker,LinkOptions+' -o '+exename+' '+inputdir+LinkResName)
-  else
-    success:=DoExec(FindLinker,LinkOptions+' -o '+exename+' @'+inputdir+LinkResName);
-{$endif}
-
+  s:=target_link.linkcmd;
+  Replace(s,'$EXE',exename);
+  Replace(s,'$OPT',LinkOptions);
+  Replace(s,'$RES',inputdir+LinkResName);
+  success:=DoExec(FindLinker,s,true);
+  
 {Bind}
   if target_info.target=target_os2 then
    begin
@@ -326,8 +362,9 @@ begin
         Message(exec_w_binder_not_found);
         externlink:=true;
       end;
-     DoExec(bindbin,'-k'+s+' -o '+exename+'.exe '+exename+' -aim -s'+s2);
+     DoExec(bindbin,'-k'+s+' -o '+exename+'.exe '+exename+' -aim -s'+s2,false);
    end;
+{Remove ReponseFile}
   if (success) and (not externlink) then
    begin
      assign(dummy,LinkResName);
@@ -336,193 +373,60 @@ begin
      {$I+}
      i:=ioresult;
    end;
-  link:=success;   { otherwise a recursive call to link method }
+  MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
 
 
-Procedure TLinker.Make_Library;
+Procedure TLinker.MakeStaticLibrary(const path:string);
 var
-{$ifndef linux}
-  arbin : string;
+  arbin   : string;
   arfound : boolean;
-{$endif}
+  i       : word;
+  f       : file;
+  Dir     : searchrec;
 begin
-  if cs_shared_lib in initswitches then
+  arbin:=FindExe('ar',arfound);
+  if (not arfound) and (not externlink) then
    begin
-     WriteResponseFile;
-{$ifdef linux}
-     DoExec(FindLinker,' -o '+libname+'.so -shared link.res');
-{$else}
-     arbin:=FindExe('ar',arfound);
-     if (not arfound) and (not externlink) then
+     Message(exec_w_ar_not_found);
+     externlink:=true;
+   end;
+  DoExec(arbin,'rs '+staticlibname+' '+FixPath(path)+'*'+target_info.objext,false);
+{ Clean up }
+  if (not writeasmfile) and (not externlink) then
+   begin
+     findfirst(FixPath(path)+'*'+target_info.objext,$20,Dir);
+     while doserror=0 do
       begin
-        Message(exec_w_ar_not_found);
-        externlink:=true;
+        assign(f,FixPath(path)+dir.name);
+        {$I-}
+        erase(f);
+        {$I+}
+        i:=ioresult;
+        findnext(dir);
       end;
-     DoExec(arbin,'rs '+libname+'.a');
-{$endif}
+     {$I-}
+      rmdir(path);
+     {$I+}
+     i:=ioresult;
    end;
 end;
 
+
+Procedure TLinker.MakeSharedLibrary;
+begin
+  DoExec(FindLinker,' -shared -o '+sharedlibname+' link.res',false);
+end;
+
+
 end.
 {
   $Log$
-  Revision 1.3  1998-04-16 10:54:30  daniel
-  * Fixed linking for OS/2.
-
-  Revision 1.2  1998/03/30 09:50:49  michael
-  + fix for library support.
-
-  Revision 1.1.1.1  1998/03/25 11:18:13  root
-  * Restored version
-
-  Revision 1.31  1998/03/13 22:45:58  florian
-    * small bug fixes applied
-
-  Revision 1.30  1998/03/11 22:22:52  florian
-    * Fixed circular unit uses, when the units are not in the current dir (from Peter)
-    * -i shows correct info, not <lf> anymore (from Peter)
-    * linking with shared libs works again (from Peter)
-
-  Revision 1.29  1998/03/10 16:27:39  pierre
-    * better line info in stabs debug
-    * symtabletype and lexlevel separated into two fields of tsymtable
-    + ifdef MAKELIB for direct library output, not complete
-    + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
-      working
-    + ifdef TESTFUNCRET for setting func result in underfunction, not
-      working
-
-  Revision 1.28  1998/03/10 01:17:19  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.27  1998/03/05 22:43:47  florian
-    * some win32 support stuff added
-
-  Revision 1.26  1998/03/04 01:35:04  peter
-    * messages for unit-handling and assembler/linker
-    * the compiler compiles without -dGDB, but doesn't work yet
-    + -vh for Hint
-
-  Revision 1.25  1998/03/02 01:48:42  peter
-    * renamed target_DOS to target_GO32V1
-    + new verbose system, merged old errors and verbose units into one new
-      verbose.pas, so errors.pas is obsolete
-
-  Revision 1.24  1998/03/01 22:46:12  florian
-    + some win95 linking stuff
-    * a couple of bugs fixed:
-      bug0055,bug0058,bug0059,bug0064,bug0072,bug0093,bug0095,bug0098
-
-  Revision 1.23  1998/02/28 03:56:15  carl
-    + replaced target_info.short_name by target_info.target (a bit faster)
-
-  Revision 1.22  1998/02/26 11:57:09  daniel
-  * New assembler optimizations commented out, because of bugs.
-  * Use of dir-/name- and extstr.
-
-  Revision 1.21  1998/02/25 20:26:41  michael
-  + fixed linking for linux
-
-  Revision 1.20  1998/02/24 14:20:53  peter
-    + tstringcontainer.empty
-    * ld -T option restored for linux
-    * libraries are placed before the objectfiles in a .PPU file
-    * removed 'uses link' from files.pas
-
-  Revision 1.19  1998/02/23 02:54:23  carl
-    * bugfix of recusrive call to link
-
-  Revision 1.18  1998/02/22 23:03:18  peter
-    * renamed msource->mainsource and name->unitname
-    * optimized filename handling, filename is not seperate anymore with
-      path+name+ext, this saves stackspace and a lot of fsplit()'s
-    * recompiling of some units in libraries fixed
-    * shared libraries are working again
-    + $LINKLIB <lib> to support automatic linking to libraries
-    + libraries are saved/read from the ppufile, also allows more libraries
-      per ppufile
-
-  Revision 1.17  1998/02/19 00:11:00  peter
-    * fixed -g to work again
-    * fixed some typos with the scriptobject
-
-  Revision 1.16  1998/02/18 13:48:16  michael
-  + Implemented an OS independent AsmRes object.
-
-  Revision 1.15  1998/02/18 08:55:26  michael
-  * Removed double declaration of LinkerOptions
-
-  Revision 1.14  1998/02/17 21:20:50  peter
-    + Script unit
-    + __EXIT is called again to exit a program
-    - target_info.link/assembler calls
-    * linking works again for dos
-    * optimized a few filehandling functions
-    * fixed stabs generation for procedures
-
-  Revision 1.13  1998/02/16 13:46:40  michael
-  + Further integration of linker object:
-    - all options pertaining to linking go directly to linker object
-    - removed redundant variables/procedures, especially in OS_TARG...
-
-  Revision 1.12  1998/02/16 12:51:31  michael
-  + Implemented linker object
-
-  Revision 1.11  1998/02/15 21:16:21  peter
-    * all assembler outputs supported by assemblerobject
-    * cleanup with assembleroutputs, better .ascii generation
-    * help_constructor/destructor are now added to the externals
-    - generation of asmresponse is not outputformat depended
-
-  Revision 1.10  1998/02/14 01:45:21  peter
-    * more fixes
-    - pmode target is removed
-    - search_as_ld is removed, this is done in the link.pas/assemble.pas
-    + findexe() to search for an executable (linker,assembler,binder)
-
-  Revision 1.9  1998/02/13 22:26:28  peter
-    * fixed a few SigSegv's
-    * INIT$$ was not written for linux!
-    * assembling and linking works again for linux and dos
-    + assembler object, only attasmi3 supported yet
-    * restore pp.pas with AddPath etc.
-
-  Revision 1.8  1998/02/13 10:35:09  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
->>>>>>> h:/cvs/compiler/link.pas
-  Revision 1.7  1998/02/02 00:55:32  peter
-    * defdatei -> deffile and some german comments to english
-    * search() accepts : as seperater under linux
-    * search for ppc.cfg doesn't open a file (and let it open)
-    * reorganize the reading of parameters/file a bit
-    * all the PPC_ environments are now for all platforms
-
-  Revision 1.6  1998/02/01 15:02:11  florian
-    * swapvectors around exec inserted
-
-  Revision 1.5  1998/01/28 13:48:39  michael
-  + Initial implementation for making libs from within FPC. Not tested, as compiler does not run
-
-  Revision 1.4  1998/01/25 18:45:43  peter
-    + Search for as and ld at startup
-    + source_info works the same as target_info
-    + externlink allows only external linking
-
-  Revision 1.3  1998/01/24 00:36:07  florian
-    + small fix to get it working with DOS (dynamiclinker isn't declared for dos)
-
-  Revision 1.2  1998/01/23 22:19:17  michael
-  + Implemented setting of dynamic linker name (linux only).
-    Declared Make_library
-    -Fd switch sets linker (linux only)
-  * Reinstated -E option of Pierre
-
-  Revision 1.1  1998/01/23 17:57:41  michael
-  + Initial implementation.
+  Revision 1.4  1998-05-04 17:54:25  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
 
+  Revision 1.3  1998/04/16 10:54:30  daniel
+  * Fixed linking for OS/2.
 }

+ 2 - 1
compiler/msgidx.inc

@@ -424,7 +424,8 @@ exec_w_cant_call_assembler,
 exec_i_assembling,
 exec_w_linker_not_found,
 exec_u_using_linker,
-exec_e_objfile_not_found,
+exec_w_objfile_not_found,
+exec_w_libfile_not_found,
 exec_w_error_while_linking,
 exec_w_cant_call_linker,
 exec_i_linking,

+ 489 - 488
compiler/msgtxt.inc

@@ -1,4 +1,4 @@
-const msgtxt : array[1..14106] of char=(
+const msgtxt : array[1..14129] of char=(
   'I','_','$','1',' ','k','B',' ','f','r','e','e',#000,'L','_',
   '$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ',
   'f','r','e','e',#000,'I','_','$','1',' ','s','t','r','e','a',
@@ -448,495 +448,496 @@ const msgtxt : array[1..14106] of char=(
   'i','n','i','t','i','o','n',' ','n','o','t',' ','r','e','s',
   'o','l','v','e','d',' ','$','1',#000,'H','_','P','a','r','a',
   'm','e','t','e','r',' ','n','o','t',' ','u','s','e','d',' ',
-  '$','1',',',' ','d','e','c','l','a','r','e','d',' ','i','n',
-  ' ','l','i','n','e',' ','$','2',#000,'W','_','L','o','c','a',
-  'l',' ','v','a','r','i','a','b','l','e',' ','n','o','t',' ',
-  'u','s','e','d',' ','$','1',',',' ','d','e','c','l','a','r',
-  'e','d',' ','i','n',' ','l','i','n','e',' ','$','2',#000,'E',
-  '_','S','e','t',' ','e','l','e','m','e','n','t','s',' ','a',
-  'r','e',' ','n','o','t',' ','c','o','m','p','a','t','i','b',
-  'l','e',#000,'E','_','S','e','t',' ','t','y','p','e',' ','e',
-  'x','p','e','c','t','e','d',#000,'W','_','F','u','n','c','t',
-  'i','o','n',' ','r','e','s','u','l','t',' ','d','o','e','s',
-  ' ','n','o','t',' ','s','e','e','m',' ','t','o',' ','b','e',
-  ' ','s','e','t',#000,'E','_','U','n','k','n','o','w','n',' ',
-  'f','i','e','l','d',' ','i','d','e','n','t','i','f','i','e',
-  'r',#000,'N','_','L','o','c','a','l',' ','v','a','r','i','a',
-  'b','l','e',' ','d','o','e','s',' ','n','o','t',' ','s','e',
-  'e','m',' ','t','o',' ','b','e',' ','i','n','i','t','i','a',
-  'l','i','z','e','d',':',' ','$','1',#000,'E','_','i','d','e',
-  'n','t','i','f','i','e','r',' ','i','d','e','n','t','s',' ',
-  'n','o',' ','m','e','m','b','e','r',#000,'E','_','B','R','E',
-  'A','K',' ','n','o','t',' ','a','l','l','o','w','e','d',#000,
-  'E','_','C','O','N','T','I','N','U','E',' ','n','o','t',' ',
-  'a','l','l','o','w','e','d',#000,'E','_','E','x','p','r','e',
-  's','s','i','o','n',' ','t','o','o',' ','c','o','m','p','l',
-  'i','c','a','t','e','d',' ','-',' ','F','P','U',' ','s','t',
-  'a','c','k',' ','o','v','e','r','f','l','o','w',#000,'E','_',
-  'I','l','l','e','g','a','l',' ','e','x','p','r','e','s','s',
-  'i','o','n',#000,'E','_','I','n','v','a','l','i','d',' ','i',
-  'n','t','e','g','e','r',#000,'E','_','I','l','l','e','g','a',
-  'l',' ','q','u','a','l','i','f','i','e','r',#000,'E','_','H',
-  'i','g','h',' ','r','a','n','g','e',' ','l','i','m','i','t',
-  ' ','<',' ','l','o','w',' ','r','a','n','g','e',' ','l','i',
-  'm','i','t',#000,'E','_','I','l','l','e','g','a','l',' ','c',
-  'o','u','n','t','e','r',' ','v','a','r','i','a','b','l','e',
-  #000,'E','_','C','a','n',#039,'t',' ','d','e','t','e','r','m',
-  'i','n','e',' ','w','h','i','c','h',' ','o','v','e','r','l',
-  'o','a','d','e','d',' ','f','u','n','c','t','i','o','n',' ',
-  't','o',' ','c','a','l','l',#000,'E','_','P','a','r','a','m',
-  'e','t','e','r',' ','l','i','s','t',' ','s','i','z','e',' ',
-  'e','x','c','e','e','d','s',' ','6','5','5','3','5',' ','b',
-  'y','t','e','s',#000,'E','_','I','l','l','e','g','a','l',' ',
-  't','y','p','e',' ','c','o','n','v','e','r','s','i','o','n',
-  #000,'E','_','F','i','l','e',' ','t','y','p','e','s',' ','m',
-  'u','s','t',' ','b','e',' ','v','a','r',' ','p','a','r','a',
-  'm','e','t','e','r','s',#000,'E','_','T','h','e',' ','u','s',
-  'e',' ','o','f',' ','a',' ','f','a','r',' ','p','o','i','n',
-  't','e','r',' ','i','s','n',#039,'t',' ','a','l','l','o','w',
-  'e','d',' ','t','h','e','r','e',#000,'E','_','i','l','l','e',
-  'g','a','l',' ','c','a','l','l',' ','b','y',' ','r','e','f',
-  'e','r','e','n','c','e',' ','p','a','r','a','m','e','t','e',
-  'r','s',#000,'E','_','E','X','P','O','R','T',' ','d','e','c',
-  'l','a','r','e','d',' ','f','u','n','c','t','i','o','n','s',
-  ' ','c','a','n',#039,'t',' ','b','e',' ','c','a','l','l','e',
-  'd',#000,'W','_','P','o','s','s','i','b','l','e',' ','i','l',
-  'l','e','g','a','l',' ','c','a','l','l',' ','o','f',' ','c',
-  'o','n','s','t','r','u','c','t','o','r',' ','o','r',' ','d',
-  'e','s','t','r','u','c','t','o','r',' ','(','d','o','e','s',
-  'n',#039,'t',' ','m','a','t','c','h',' ','t','o',' ','t','h',
-  'i','s',' ','c','o','n','t','e','x','t',')',#000,'N','_','I',
-  'n','e','f','f','i','c','i','e','n','t',' ','c','o','d','e',
-  #000,'W','_','u','n','r','e','a','c','h','a','b','l','e',' ',
-  'c','o','d','e',#000,'E','_','p','r','o','c','e','d','u','r',
-  'e',' ','c','a','l','l',' ','w','i','t','h',' ','s','t','a',
-  'c','k','f','r','a','m','e',' ','E','S','P','/','S','P',#000,
-  'E','_','A','b','s','t','r','a','c','t',' ','m','e','t','h',
-  'o','d','s',' ','c','a','n',#039,'t',' ','b','e',' ','c','a',
-  'l','l','e','d',' ','d','i','r','e','c','t','l','y',#000,'F',
-  '_','I','n','t','e','r','n','a','l',' ','E','r','r','o','r',
-  ' ','i','n',' ','g','e','t','f','l','o','a','t','r','e','g',
-  '(',')',',',' ','a','l','l','o','c','a','t','i','o','n',' ',
-  'f','a','i','l','u','r','e',#000,'F','_','U','n','k','n','o',
-  'w','n',' ','f','l','o','a','t',' ','t','y','p','e',#000,'F',
-  '_','S','e','c','o','n','d','V','e','c','n','(',')',' ','b',
-  'a','s','e',' ','d','e','f','i','n','e','d',' ','t','w','i',
-  'c','e',#000,'F','_','E','x','t','e','n','d','e','d',' ','c',
-  'g','6','8','k',' ','n','o','t',' ','s','u','p','p','o','r',
-  't','e','d',#000,'F','_','3','2','-','b','i','t',' ','u','n',
-  's','i','g','n','e','d',' ','n','o','t',' ','s','u','p','p',
-  'o','r','t','e','d',' ','i','n',' ','M','C','6','8','0','0',
-  '0',' ','m','o','d','e',#000,'F','_','I','n','t','e','r','n',
-  'a','l',' ','E','r','r','o','r',' ','i','n',' ','s','e','c',
-  'o','n','d','i','n','l','i','n','e','(',')',#000,'D','_','R',
-  'e','g','i','s','t','e','r',' ','$','1',' ','w','e','i','g',
-  'h','t',' ','$','2',' ','$','3',#000,'E','_','S','t','a','c',
-  'k',' ','l','i','m','i','t',' ','e','x','c','e','d','e','e',
-  'd',' ','i','n',' ','l','o','c','a','l',' ','r','o','u','t',
-  'i','n','e',#000,'D','_','S','t','a','c','k',' ','f','r','a',
-  'm','e',' ','i','s',' ','o','m','i','t','e','d',#000,'F','_',
-  'D','i','v','i','d','e',' ','b','y',' ','z','e','r','o',' ',
-  'i','n',' ','a','s','m',' ','e','v','a','l','u','a','t','o',
-  'r',#000,'F','_','E','v','a','l','u','a','t','o','r',' ','s',
-  't','a','c','k',' ','o','v','e','r','f','l','o','w',#000,'F',
-  '_','E','v','a','l','u','a','t','o','r',' ','s','t','a','c',
-  'k',' ','u','n','d','e','r','f','l','o','w',#000,'F','_','I',
-  'n','v','a','l','i','d',' ','n','u','m','e','r','i','c',' ',
-  'f','o','r','m','a','t',' ','i','n',' ','a','s','m',' ','e',
-  'v','a','l','u','a','t','o','r',#000,'F','_','I','n','v','a',
-  'l','i','d',' ','O','p','e','r','a','t','o','r',' ','i','n',
-  ' ','a','s','m',' ','e','v','a','l','u','a','t','o','r',#000,
-  'F','_','U','n','k','n','o','w','n',' ','e','r','r','o','r',
+  '$','1',' ','i','n',' ','l','i','n','e',' ','$','2',#000,'W',
+  '_','L','o','c','a','l',' ','v','a','r','i','a','b','l','e',
+  ' ','n','o','t',' ','u','s','e','d',' ','$','1',' ','i','n',
+  ' ','l','i','n','e',' ','$','2',#000,'E','_','S','e','t',' ',
+  'e','l','e','m','e','n','t','s',' ','a','r','e',' ','n','o',
+  't',' ','c','o','m','p','a','t','i','b','l','e',#000,'E','_',
+  'S','e','t',' ','t','y','p','e',' ','e','x','p','e','c','t',
+  'e','d',#000,'W','_','F','u','n','c','t','i','o','n',' ','r',
+  'e','s','u','l','t',' ','d','o','e','s',' ','n','o','t',' ',
+  's','e','e','m',' ','t','o',' ','b','e',' ','s','e','t',#000,
+  'E','_','U','n','k','n','o','w','n',' ','f','i','e','l','d',
+  ' ','i','d','e','n','t','i','f','i','e','r',#000,'N','_','L',
+  'o','c','a','l',' ','v','a','r','i','a','b','l','e',' ','$',
+  '1',' ','d','o','e','s',' ','n','o','t',' ','s','e','e','m',
+  ' ','t','o',' ','b','e',' ','i','n','i','t','i','a','l','i',
+  'z','e','d',#000,'E','_','i','d','e','n','t','i','f','i','e',
+  'r',' ','i','d','e','n','t','s',' ','n','o',' ','m','e','m',
+  'b','e','r',#000,'E','_','B','R','E','A','K',' ','n','o','t',
+  ' ','a','l','l','o','w','e','d',#000,'E','_','C','O','N','T',
+  'I','N','U','E',' ','n','o','t',' ','a','l','l','o','w','e',
+  'd',#000,'E','_','E','x','p','r','e','s','s','i','o','n',' ',
+  't','o','o',' ','c','o','m','p','l','i','c','a','t','e','d',
+  ' ','-',' ','F','P','U',' ','s','t','a','c','k',' ','o','v',
+  'e','r','f','l','o','w',#000,'E','_','I','l','l','e','g','a',
+  'l',' ','e','x','p','r','e','s','s','i','o','n',#000,'E','_',
+  'I','n','v','a','l','i','d',' ','i','n','t','e','g','e','r',
+  #000,'E','_','I','l','l','e','g','a','l',' ','q','u','a','l',
+  'i','f','i','e','r',#000,'E','_','H','i','g','h',' ','r','a',
+  'n','g','e',' ','l','i','m','i','t',' ','<',' ','l','o','w',
+  ' ','r','a','n','g','e',' ','l','i','m','i','t',#000,'E','_',
+  'I','l','l','e','g','a','l',' ','c','o','u','n','t','e','r',
+  ' ','v','a','r','i','a','b','l','e',#000,'E','_','C','a','n',
+  #039,'t',' ','d','e','t','e','r','m','i','n','e',' ','w','h',
+  'i','c','h',' ','o','v','e','r','l','o','a','d','e','d',' ',
+  'f','u','n','c','t','i','o','n',' ','t','o',' ','c','a','l',
+  'l',#000,'E','_','P','a','r','a','m','e','t','e','r',' ','l',
+  'i','s','t',' ','s','i','z','e',' ','e','x','c','e','e','d',
+  's',' ','6','5','5','3','5',' ','b','y','t','e','s',#000,'E',
+  '_','I','l','l','e','g','a','l',' ','t','y','p','e',' ','c',
+  'o','n','v','e','r','s','i','o','n',#000,'E','_','F','i','l',
+  'e',' ','t','y','p','e','s',' ','m','u','s','t',' ','b','e',
+  ' ','v','a','r',' ','p','a','r','a','m','e','t','e','r','s',
+  #000,'E','_','T','h','e',' ','u','s','e',' ','o','f',' ','a',
+  ' ','f','a','r',' ','p','o','i','n','t','e','r',' ','i','s',
+  'n',#039,'t',' ','a','l','l','o','w','e','d',' ','t','h','e',
+  'r','e',#000,'E','_','i','l','l','e','g','a','l',' ','c','a',
+  'l','l',' ','b','y',' ','r','e','f','e','r','e','n','c','e',
+  ' ','p','a','r','a','m','e','t','e','r','s',#000,'E','_','E',
+  'X','P','O','R','T',' ','d','e','c','l','a','r','e','d',' ',
+  'f','u','n','c','t','i','o','n','s',' ','c','a','n',#039,'t',
+  ' ','b','e',' ','c','a','l','l','e','d',#000,'W','_','P','o',
+  's','s','i','b','l','e',' ','i','l','l','e','g','a','l',' ',
+  'c','a','l','l',' ','o','f',' ','c','o','n','s','t','r','u',
+  'c','t','o','r',' ','o','r',' ','d','e','s','t','r','u','c',
+  't','o','r',' ','(','d','o','e','s','n',#039,'t',' ','m','a',
+  't','c','h',' ','t','o',' ','t','h','i','s',' ','c','o','n',
+  't','e','x','t',')',#000,'N','_','I','n','e','f','f','i','c',
+  'i','e','n','t',' ','c','o','d','e',#000,'W','_','u','n','r',
+  'e','a','c','h','a','b','l','e',' ','c','o','d','e',#000,'E',
+  '_','p','r','o','c','e','d','u','r','e',' ','c','a','l','l',
+  ' ','w','i','t','h',' ','s','t','a','c','k','f','r','a','m',
+  'e',' ','E','S','P','/','S','P',#000,'E','_','A','b','s','t',
+  'r','a','c','t',' ','m','e','t','h','o','d','s',' ','c','a',
+  'n',#039,'t',' ','b','e',' ','c','a','l','l','e','d',' ','d',
+  'i','r','e','c','t','l','y',#000,'F','_','I','n','t','e','r',
+  'n','a','l',' ','E','r','r','o','r',' ','i','n',' ','g','e',
+  't','f','l','o','a','t','r','e','g','(',')',',',' ','a','l',
+  'l','o','c','a','t','i','o','n',' ','f','a','i','l','u','r',
+  'e',#000,'F','_','U','n','k','n','o','w','n',' ','f','l','o',
+  'a','t',' ','t','y','p','e',#000,'F','_','S','e','c','o','n',
+  'd','V','e','c','n','(',')',' ','b','a','s','e',' ','d','e',
+  'f','i','n','e','d',' ','t','w','i','c','e',#000,'F','_','E',
+  'x','t','e','n','d','e','d',' ','c','g','6','8','k',' ','n',
+  'o','t',' ','s','u','p','p','o','r','t','e','d',#000,'F','_',
+  '3','2','-','b','i','t',' ','u','n','s','i','g','n','e','d',
+  ' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',' ',
+  'i','n',' ','M','C','6','8','0','0','0',' ','m','o','d','e',
+  #000,'F','_','I','n','t','e','r','n','a','l',' ','E','r','r',
+  'o','r',' ','i','n',' ','s','e','c','o','n','d','i','n','l',
+  'i','n','e','(',')',#000,'D','_','R','e','g','i','s','t','e',
+  'r',' ','$','1',' ','w','e','i','g','h','t',' ','$','2',' ',
+  '$','3',#000,'E','_','S','t','a','c','k',' ','l','i','m','i',
+  't',' ','e','x','c','e','d','e','e','d',' ','i','n',' ','l',
+  'o','c','a','l',' ','r','o','u','t','i','n','e',#000,'D','_',
+  'S','t','a','c','k',' ','f','r','a','m','e',' ','i','s',' ',
+  'o','m','i','t','e','d',#000,'F','_','D','i','v','i','d','e',
+  ' ','b','y',' ','z','e','r','o',' ','i','n',' ','a','s','m',
+  ' ','e','v','a','l','u','a','t','o','r',#000,'F','_','E','v',
+  'a','l','u','a','t','o','r',' ','s','t','a','c','k',' ','o',
+  'v','e','r','f','l','o','w',#000,'F','_','E','v','a','l','u',
+  'a','t','o','r',' ','s','t','a','c','k',' ','u','n','d','e',
+  'r','f','l','o','w',#000,'F','_','I','n','v','a','l','i','d',
+  ' ','n','u','m','e','r','i','c',' ','f','o','r','m','a','t',
   ' ','i','n',' ','a','s','m',' ','e','v','a','l','u','a','t',
-  'o','r',#000,'W','_','I','n','v','a','l','i','d',' ','n','u',
-  'm','e','r','i','c',' ','v','a','l','u','e',#000,'E','_','e',
-  's','c','a','p','e',' ','s','e','q','u','e','n','c','e',' ',
-  'i','g','n','o','r','e','d',':',' ','$','1',#000,'E','_','A',
-  's','m',' ','s','y','n','t','a','x',' ','e','r','r','o','r',
-  ' ','-',' ','P','r','e','f','i','x',' ','n','o','t',' ','f',
-  'o','u','n','d',#000,'E','_','A','s','m',' ','s','y','n','t',
-  'a','x',' ','e','r','r','o','r',' ','-',' ','T','r','y','i',
-  'n','g',' ','t','o',' ','a','d','d',' ','m','o','r','e',' ',
-  't','h','a','n',' ','o','n','e',' ','p','r','e','f','i','x',
-  #000,'E','_','A','s','m',' ','s','y','n','t','a','x',' ','e',
-  'r','r','o','r',' ','-',' ','O','p','c','o','d','e',' ','n',
-  'o','t',' ','f','o','u','n','d',#000,'E','_','I','n','v','a',
-  'l','i','d',' ','s','y','m','b','o','l',' ','r','e','f','e',
-  'r','e','n','c','e',#000,'W','_','C','a','l','l','i','n','g',
-  ' ','a','n',' ','o','v','e','r','l','o','a','d',' ','f','u',
-  'n','c','t','i','o','n',' ','i','n',' ','a','n',' ','a','s',
-  'm',#000,'E','_','C','o','n','s','t','a','n','t',' ','v','a',
-  'l','u','e',' ','o','u','t',' ','o','f',' ','b','o','u','n',
-  'd','s',#000,'E','_','N','o','n','-','l','a','b','e','l',' ',
-  'p','a','t','t','e','r','n',' ','c','o','n','t','a','i','n',
-  's',' ','@',#000,'E','_','I','n','v','a','l','i','d',' ','O',
-  'p','e','r','a','n','d',':',' ','$','1',#000,'W','_','O','v',
-  'e','r','r','i','d','e',' ','o','p','e','r','a','t','o','r',
-  ' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,
-  'E','_','E','r','r','o','r',' ','i','n',' ','b','i','n','a',
-  'r','y',' ','c','o','n','s','t','a','n','t',':',' ','$','1',
-  #000,'E','_','E','r','r','o','r',' ','i','n',' ','o','c','t',
+  'o','r',#000,'F','_','I','n','v','a','l','i','d',' ','O','p',
+  'e','r','a','t','o','r',' ','i','n',' ','a','s','m',' ','e',
+  'v','a','l','u','a','t','o','r',#000,'F','_','U','n','k','n',
+  'o','w','n',' ','e','r','r','o','r',' ','i','n',' ','a','s',
+  'm',' ','e','v','a','l','u','a','t','o','r',#000,'W','_','I',
+  'n','v','a','l','i','d',' ','n','u','m','e','r','i','c',' ',
+  'v','a','l','u','e',#000,'E','_','e','s','c','a','p','e',' ',
+  's','e','q','u','e','n','c','e',' ','i','g','n','o','r','e',
+  'd',':',' ','$','1',#000,'E','_','A','s','m',' ','s','y','n',
+  't','a','x',' ','e','r','r','o','r',' ','-',' ','P','r','e',
+  'f','i','x',' ','n','o','t',' ','f','o','u','n','d',#000,'E',
+  '_','A','s','m',' ','s','y','n','t','a','x',' ','e','r','r',
+  'o','r',' ','-',' ','T','r','y','i','n','g',' ','t','o',' ',
+  'a','d','d',' ','m','o','r','e',' ','t','h','a','n',' ','o',
+  'n','e',' ','p','r','e','f','i','x',#000,'E','_','A','s','m',
+  ' ','s','y','n','t','a','x',' ','e','r','r','o','r',' ','-',
+  ' ','O','p','c','o','d','e',' ','n','o','t',' ','f','o','u',
+  'n','d',#000,'E','_','I','n','v','a','l','i','d',' ','s','y',
+  'm','b','o','l',' ','r','e','f','e','r','e','n','c','e',#000,
+  'W','_','C','a','l','l','i','n','g',' ','a','n',' ','o','v',
+  'e','r','l','o','a','d',' ','f','u','n','c','t','i','o','n',
+  ' ','i','n',' ','a','n',' ','a','s','m',#000,'E','_','C','o',
+  'n','s','t','a','n','t',' ','v','a','l','u','e',' ','o','u',
+  't',' ','o','f',' ','b','o','u','n','d','s',#000,'E','_','N',
+  'o','n','-','l','a','b','e','l',' ','p','a','t','t','e','r',
+  'n',' ','c','o','n','t','a','i','n','s',' ','@',#000,'E','_',
+  'I','n','v','a','l','i','d',' ','O','p','e','r','a','n','d',
+  ':',' ','$','1',#000,'W','_','O','v','e','r','r','i','d','e',
+  ' ','o','p','e','r','a','t','o','r',' ','n','o','t',' ','s',
+  'u','p','p','o','r','t','e','d',#000,'E','_','E','r','r','o',
+  'r',' ','i','n',' ','b','i','n','a','r','y',' ','c','o','n',
+  's','t','a','n','t',':',' ','$','1',#000,'E','_','E','r','r',
+  'o','r',' ','i','n',' ','o','c','t','a','l',' ','c','o','n',
+  's','t','a','n','t',':',' ','$','1',#000,'E','_','E','r','r',
+  'o','r',' ','i','n',' ','h','e','x','a','d','e','c','i','m',
   'a','l',' ','c','o','n','s','t','a','n','t',':',' ','$','1',
-  #000,'E','_','E','r','r','o','r',' ','i','n',' ','h','e','x',
-  'a','d','e','c','i','m','a','l',' ','c','o','n','s','t','a',
-  'n','t',':',' ','$','1',#000,'E','_','E','r','r','o','r',' ',
-  'i','n',' ','i','n','t','e','g','e','r',' ','c','o','n','s',
-  't','a','n','t',':',' ','$','1',#000,'E','_','I','n','v','a',
-  'l','i','d',' ','l','a','b','e','l','e','d',' ','o','p','c',
-  'o','d','e',#000,'F','_','I','n','t','e','r','n','a','l',' ',
-  'e','r','r','o','r',' ','i','n',' ','F','i','n','d','t','y',
-  'p','e','(',')',#000,'E','_','I','n','v','a','l','i','d',' ',
-  's','i','z','e',' ','f','o','r',' ','M','O','V','S','X','/',
-  'M','O','V','Z','X',#000,'E','_','1','6','-','b','i','t',' ',
-  'b','a','s','e',' ','i','n',' ','3','2','-','b','i','t',' ',
-  's','e','g','m','e','n','t',#000,'E','_','1','6','-','b','i',
-  't',' ','i','n','d','e','x',' ','i','n',' ','3','2','-','b',
-  'i','t',' ','s','e','g','m','e','n','t',#000,'E','_','I','n',
-  'v','a','l','i','d',' ','O','p','c','o','d','e',#000,'E','_',
-  'C','o','n','s','t','a','n','t',' ','r','e','f','e','r','e',
-  'n','c','e',' ','n','o','t',' ','a','l','l','o','w','e','d',
-  #000,'W','_','F','w','a','i','t',' ','c','a','n',' ','c','a',
-  'u','s','e',' ','e','m','u','l','a','t','i','o','n',' ','p',
-  'r','o','b','l','e','m','s',' ','w','i','t','h',' ','e','m',
-  'u','3','8','7',#000,'E','_','I','n','v','a','l','i','d',' ',
-  'c','o','m','b','i','n','a','t','i','o','n',' ','o','f',' ',
-  'o','p','c','o','d','e',' ','a','n','d',' ','o','p','e','r',
-  'a','n','d','s',#000,'W','_','O','p','c','o','d','e',' ','$',
-  '1',' ','n','o','t',' ','i','n',' ','t','a','b','l','e',',',
-  ' ','o','p','e','r','a','n','d','s',' ','n','o','t',' ','c',
-  'h','e','c','k','e','d',#000,'F','_','I','n','t','e','r','n',
-  'a','l',' ','E','r','r','o','r',' ','i','n',' ','C','o','n',
-  'c','a','t','O','p','c','o','d','e','(',')',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','s','i','z','e',' ','i','n',' ',
-  'r','e','f','e','r','e','n','c','e',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','m','i','d','d','l','e',' ','s','i','z',
-  'e','d',' ','o','p','e','r','a','n','d',#000,'E','_','I','n',
-  'v','a','l','i','d',' ','t','h','r','e','e',' ','o','p','e',
-  'r','a','n','d',' ','o','p','c','o','d','e',#000,'E','_','A',
-  's','s','e','m','b','l','e','r',' ','s','y','n','t','a','x',
-  ' ','e','r','r','o','r',#000,'E','_','I','n','v','a','l','i',
-  'd',' ','o','p','e','r','a','n','d',' ','t','y','p','e',#000,
-  'E','_','S','e','g','m','e','n','t',' ','o','v','e','r','r',
-  'i','d','e','s',' ','n','o','t',' ','s','u','p','p','o','r',
-  't','e','d',#000,'E','_','I','n','v','a','l','i','d',' ','c',
-  'o','n','s','t','a','n','t',' ','s','y','m','b','o','l',' ',
-  '$','1',#000,'F','_','I','n','t','e','r','n','a','l',' ','E',
+  #000,'E','_','E','r','r','o','r',' ','i','n',' ','i','n','t',
+  'e','g','e','r',' ','c','o','n','s','t','a','n','t',':',' ',
+  '$','1',#000,'E','_','I','n','v','a','l','i','d',' ','l','a',
+  'b','e','l','e','d',' ','o','p','c','o','d','e',#000,'F','_',
+  'I','n','t','e','r','n','a','l',' ','e','r','r','o','r',' ',
+  'i','n',' ','F','i','n','d','t','y','p','e','(',')',#000,'E',
+  '_','I','n','v','a','l','i','d',' ','s','i','z','e',' ','f',
+  'o','r',' ','M','O','V','S','X','/','M','O','V','Z','X',#000,
+  'E','_','1','6','-','b','i','t',' ','b','a','s','e',' ','i',
+  'n',' ','3','2','-','b','i','t',' ','s','e','g','m','e','n',
+  't',#000,'E','_','1','6','-','b','i','t',' ','i','n','d','e',
+  'x',' ','i','n',' ','3','2','-','b','i','t',' ','s','e','g',
+  'm','e','n','t',#000,'E','_','I','n','v','a','l','i','d',' ',
+  'O','p','c','o','d','e',#000,'E','_','C','o','n','s','t','a',
+  'n','t',' ','r','e','f','e','r','e','n','c','e',' ','n','o',
+  't',' ','a','l','l','o','w','e','d',#000,'W','_','F','w','a',
+  'i','t',' ','c','a','n',' ','c','a','u','s','e',' ','e','m',
+  'u','l','a','t','i','o','n',' ','p','r','o','b','l','e','m',
+  's',' ','w','i','t','h',' ','e','m','u','3','8','7',#000,'E',
+  '_','I','n','v','a','l','i','d',' ','c','o','m','b','i','n',
+  'a','t','i','o','n',' ','o','f',' ','o','p','c','o','d','e',
+  ' ','a','n','d',' ','o','p','e','r','a','n','d','s',#000,'W',
+  '_','O','p','c','o','d','e',' ','$','1',' ','n','o','t',' ',
+  'i','n',' ','t','a','b','l','e',',',' ','o','p','e','r','a',
+  'n','d','s',' ','n','o','t',' ','c','h','e','c','k','e','d',
+  #000,'F','_','I','n','t','e','r','n','a','l',' ','E','r','r',
+  'o','r',' ','i','n',' ','C','o','n','c','a','t','O','p','c',
+  'o','d','e','(',')',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','s','i','z','e',' ','i','n',' ','r','e','f','e','r','e',
+  'n','c','e',#000,'E','_','I','n','v','a','l','i','d',' ','m',
+  'i','d','d','l','e',' ','s','i','z','e','d',' ','o','p','e',
+  'r','a','n','d',#000,'E','_','I','n','v','a','l','i','d',' ',
+  't','h','r','e','e',' ','o','p','e','r','a','n','d',' ','o',
+  'p','c','o','d','e',#000,'E','_','A','s','s','e','m','b','l',
+  'e','r',' ','s','y','n','t','a','x',' ','e','r','r','o','r',
+  #000,'E','_','I','n','v','a','l','i','d',' ','o','p','e','r',
+  'a','n','d',' ','t','y','p','e',#000,'E','_','S','e','g','m',
+  'e','n','t',' ','o','v','e','r','r','i','d','e','s',' ','n',
+  'o','t',' ','s','u','p','p','o','r','t','e','d',#000,'E','_',
+  'I','n','v','a','l','i','d',' ','c','o','n','s','t','a','n',
+  't',' ','s','y','m','b','o','l',' ','$','1',#000,'F','_','I',
+  'n','t','e','r','n','a','l',' ','E','r','r','r','o','r',' ',
+  'c','o','n','v','e','r','t','i','n','g',' ','b','i','n','a',
+  'r','y',#000,'F','_','I','n','t','e','r','n','a','l',' ','E',
   'r','r','r','o','r',' ','c','o','n','v','e','r','t','i','n',
-  'g',' ','b','i','n','a','r','y',#000,'F','_','I','n','t','e',
-  'r','n','a','l',' ','E','r','r','r','o','r',' ','c','o','n',
-  'v','e','r','t','i','n','g',' ','h','e','x','a','d','e','c',
-  'i','m','a','l',#000,'F','_','I','n','t','e','r','n','a','l',
-  ' ','E','r','r','r','o','r',' ','c','o','n','v','e','r','t',
-  'i','n','g',' ','o','c','t','a','l',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','c','o','n','s','t','a','n','t',' ','e',
-  'x','p','r','e','s','s','i','o','n',#000,'E','_','U','n','k',
-  'n','o','w','n',' ','i','d','e','n','t','i','f','i','e','r',
-  ':',' ','$','1',#000,'E','_','T','r','y','i','n','g',' ','t',
-  'o',' ','d','e','f','i','n','e',' ','a','n',' ','i','n','d',
-  'e','x',' ','r','e','g','i','s','t','e','r',' ','m','o','r',
-  'e',' ','t','h','a','n',' ','o','n','c','e',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','f','i','e','l','d',' ','s','p',
-  'e','c','i','f','i','e','r',#000,'F','_','I','n','t','e','r',
-  'n','a','l',' ','E','r','r','o','r',' ','i','n',' ','B','u',
-  'i','l','d','S','c','a','l','i','n','g','(',')',#000,'E','_',
-  'I','n','v','a','l','i','d',' ','s','c','a','l','i','n','g',
-  ' ','f','a','c','t','o','r',#000,'E','_','I','n','v','a','l',
-  'i','d',' ','s','c','a','l','i','n','g',' ','v','a','l','u',
-  'e',#000,'E','_','S','c','a','l','i','n','g',' ','v','a','l',
-  'u','e',' ','o','n','l','y',' ','a','l','l','o','w','e','d',
-  ' ','w','i','t','h',' ','i','n','d','e','x',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','a','s','s','e','m','b','l','e',
-  'r',' ','s','y','n','t','a','x','.',' ','N','o',' ','r','e',
-  'f',' ','w','i','t','h',' ','b','r','a','c','k','e','t','s',
-  ')',#000,'E','_','E','x','p','r','e','s','s','i','o','n','s',
-  ' ','o','f',' ','t','h','e',' ','f','o','r','m',' ','[','s',
-  'r','e','g',':','r','e','g','.','.','.',']',' ','a','r','e',
-  ' ','c','u','r','r','e','n','t','l','y',' ','n','o','t',' ',
-  's','u','p','p','o','r','t','e','d',#000,'E','_','T','r','y',
-  'i','n','g',' ','t','o',' ','d','e','f','i','n','e',' ','a',
-  ' ','s','e','g','m','e','n','t',' ','r','e','g','i','s','t',
-  'e','r',' ','t','w','i','c','e',#000,'E','_','T','r','y','i',
-  'n','g',' ','t','o',' ','d','e','f','i','n','e',' ','a',' ',
-  'b','a','s','e',' ','r','e','g','i','s','t','e','r',' ','t',
-  'w','i','c','e',#000,'E','_','T','r','y','i','n','g',' ','t',
-  'o',' ','u','s','e',' ','a',' ','n','e','g','a','t','i','v',
-  'e',' ','i','n','d','e','x',' ','r','e','g','i','s','t','e',
-  'r',#000,'E','_','A','s','m',' ','s','y','n','t','a','x',' ',
-  'e','r','r','o','r',' ','-',' ','e','r','r','o','r',' ','i',
-  'n',' ','r','e','f','e','r','e','n','c','e',#000,'E','_','L',
-  'o','c','a','l',' ','s','y','m','b','o','l','s',' ','n','o',
-  't',' ','a','l','l','o','w','e','d',' ','a','s',' ','r','e',
-  'f','e','r','e','n','c','e','s',#000,'E','_','I','n','v','a',
-  'l','i','d',' ','o','p','e','r','a','n','d',' ','i','n',' ',
-  'b','r','a','c','k','e','t',' ','e','x','p','r','e','s','s',
-  'i','o','n',#000,'E','_','I','n','v','a','l','i','d',' ','s',
-  'y','m','b','o','l',' ','n','a','m','e',':',' ','$','1',#000,
-  'E','_','I','n','v','a','l','i','d',' ','R','e','f','e','r',
-  'e','n','c','e',' ','s','y','n','t','a','x',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','s','t','r','i','n','g',' ','a',
-  's',' ','o','p','c','o','d','e',' ','o','p','e','r','a','n',
-  'd',':',' ','$','1',#000,'W','_','@','C','O','D','E',' ','a',
-  'n','d',' ','@','D','A','T','A',' ','n','o','t',' ','s','u',
-  'p','p','o','r','t','e','d',#000,'E','_','N','u','l','l',' ',
-  'l','a','b','e','l',' ','r','e','f','e','r','e','n','c','e',
-  's',' ','a','r','e',' ','n','o','t',' ','a','l','l','o','w',
-  'e','d',#000,'E','_','C','a','n','n','o','t',' ','u','s','e',
-  ' ','S','E','L','F',' ','o','u','t','s','i','d','e',' ','a',
-  ' ','m','e','t','h','o','d',#000,'E','_','A','s','m',' ','s',
-  'y','n','t','a','x',' ','e','r','r','o','r',' ','-',' ','S',
-  'h','o','u','l','d',' ','s','t','a','r','t',' ','w','i','t',
-  'h',' ','b','r','a','c','k','e','t',#000,'E','_','A','s','m',
-  ' ','s','y','n','t','a','x',' ','e','r','r','o','r',' ','-',
-  ' ','r','e','g','i','s','t','e','r',':',' ','$','1',#000,'E',
-  '_','S','E','G',' ','a','n','d',' ','O','F','F','S','E','T',
-  ' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,
-  'E','_','A','s','m',' ','s','y','n','t','a','x',' ','e','r',
-  'r','o','r',' ','-',' ','i','n',' ','o','p','c','o','d','e',
-  ' ','o','p','e','r','a','n','d',#000,'E','_','I','n','v','a',
-  'l','i','d',' ','S','t','r','i','n','g',' ','e','x','p','r',
-  'e','s','s','i','o','n',#000,'E','_','C','o','n','s','t','a',
-  'n','t',' ','e','x','p','r','e','s','s','i','o','n',' ','o',
-  'u','t',' ','o','f',' ','b','o','u','n','d','s',#000,'F','_',
-  'I','n','t','e','r','n','a','l',' ','E','r','r','o','r',' ',
-  'i','n',' ','B','u','i','l','d','C','o','n','s','t','a','n',
-  't','(',')',#000,'W','_','A',' ','r','e','p','e','a','t',' ',
-  'p','r','e','f','i','x',' ','a','n','d',' ','a',' ','s','e',
-  'g','m','e','n','t',' ','o','v','e','r','r','i','d','e',' ',
-  'o','n',' ','<','=',' ','i','3','8','6',' ','m','a','y',' ',
-  'r','e','s','u','l','t',' ','i','n',' ','e','r','r','o','r',
-  's',' ','i','f',' ','a','n',' ','i','n','t','e','r','r','u',
-  'p','t',' ','o','c','c','u','r','s',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','o','r',' ','m','i','s','s','i','n','g',
-  ' ','o','p','c','o','d','e',#000,'E','_','I','n','v','a','l',
-  'i','d',' ','c','o','m','b','i','n','a','t','i','o','n',' ',
-  'o','f',' ','p','r','e','f','i','x',' ','a','n','d',' ','o',
-  'p','c','o','d','e',':',' ','$','1',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','c','o','m','b','i','n','a','t','i','o',
-  'n',' ','o','f',' ','o','v','e','r','r','i','d','e',' ','a',
-  'n','d',' ','o','p','c','o','d','e',':',' ','$','1',#000,'E',
-  '_','T','o','o',' ','m','a','n','y',' ','o','p','e','r','a',
-  'n','d','s',' ','o','n',' ','l','i','n','e',#000,'E','_','D',
-  'u','p','l','i','c','a','t','e',' ','l','o','c','a','l',' ',
-  's','y','m','b','o','l',':',' ','$','1',#000,'E','_','U','n',
-  'k','n','o','w','n',' ','l','a','b','e','l',' ','i','d','e',
-  'n','t','i','f','e','r',':',' ','$','1',#000,'E','_','A','s',
-  's','e','m','b','l','e',' ','n','o','d','e',' ','s','y','n',
-  't','a','x',' ','e','r','r','o','r',#000,'E','_','U','n','d',
-  'e','f','i','n','e','d',' ','l','o','c','a','l',' ','s','y',
-  'm','b','o','l',':',' ','$','1',#000,'D','_','S','t','a','r',
-  't','i','n','g',' ','i','n','t','e','l',' ','s','t','y','l',
-  'e','d',' ','a','s','s','e','m','b','l','e','r',' ','p','a',
-  'r','s','i','n','g','.','.','.',#000,'D','_','F','i','n','i',
-  's','h','e','d',' ','i','n','t','e','l',' ','s','t','y','l',
-  'e','d',' ','a','s','s','e','m','b','l','e','r',' ','p','a',
-  'r','s','i','n','g','.','.','.',#000,'E','_','N','o','t',' ',
-  'a',' ','d','i','r','e','c','t','i','v','e',' ','o','r',' ',
-  'l','o','c','a','l',' ','s','y','m','b','o','l',':',' ','$',
-  '1',#000,'E','_','/',' ','a','t',' ','b','e','g','i','n','n',
-  'i','n','g',' ','o','f',' ','l','i','n','e',' ','n','o','t',
-  ' ','a','l','l','o','w','e','d',#000,'E','_','N','O','R',' ',
-  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'E',
-  '_','I','n','v','a','l','i','d',' ','f','l','o','a','t','i',
-  'n','g',' ','p','o','i','n','t',' ','r','e','g','i','s','t',
-  'e','r',' ','n','a','m','e',#000,'W','_','M','o','d','u','l',
-  'o',' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',
-  #000,'E','_','I','n','v','a','l','i','d',' ','f','l','o','a',
-  't','i','n','g',' ','p','o','i','n','t',' ','c','o','n','s',
-  't','a','n','t',':',' ','$','1',#000,'E','_','S','i','z','e',
-  ' ','s','u','f','f','i','x',' ','a','n','d',' ','d','e','s',
-  't','i','n','a','t','i','o','n',' ','r','e','g','i','s','t',
-  'e','r',' ','d','o',' ','n','o','t',' ','m','a','t','c','h',
-  #000,'E','_','I','n','t','e','r','n','a','l',' ','e','r','r',
-  'o','r',' ','i','n',' ','C','o','n','c','a','t','L','a','b',
-  'e','l','e','d','I','n','s','t','r','(',')',#000,'W','_','F',
-  'l','o','a','t','i','n','g',' ','p','o','i','n','t',' ','b',
-  'i','n','a','r','y',' ','r','e','p','r','e','s','e','n','t',
-  'a','t','i','o','n',' ','i','g','n','o','r','e','d',#000,'W',
-  '_','F','l','o','a','t','i','n','g',' ','p','o','i','n','t',
-  ' ','h','e','x','a','d','e','c','i','m','a','l',' ','r','e',
-  'p','r','e','s','e','n','t','a','t','i','o','n',' ','i','g',
-  'n','o','r','e','d',#000,'W','_','F','l','o','a','t','i','n',
-  'g',' ','p','o','i','n','t',' ','o','c','t','a','l',' ','r',
-  'e','p','r','e','s','e','n','t','a','t','i','o','n',' ','i',
-  'g','n','o','r','e','d',#000,'E','_','I','n','v','a','l','i',
-  'd',' ','r','e','a','l',' ','c','o','n','s','t','a','n','t',
-  ' ','e','x','p','r','e','s','s','i','o','n',#000,'E','_','P',
-  'a','r','e','n','t','h','e','s','i','s',' ','a','r','e',' ',
-  'n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','R','e','f','e','r','e','n','c',
-  'e',#000,'E','_','C','a','n','n','o','t',' ','u','s','e',' ',
-  '_','_','S','E','L','F',' ','o','u','t','s','i','d','e',' ',
-  'a',' ','m','e','t','h','o','d',#000,'E','_','C','a','n','n',
-  'o','t',' ','u','s','e',' ','_','_','O','L','D','E','B','P',
-  ' ','o','u','t','s','i','d','e',' ','a',' ','n','e','s','t',
-  'e','d',' ','p','r','o','c','e','d','u','r','e',#000,'W','_',
-  'I','d','e','n','t','i','f','i','e','r',' ','$','1',' ','s',
-  'u','p','p','o','s','e','d',' ','e','x','t','e','r','n','a',
-  'l',#000,'E','_','I','n','v','a','l','i','d',' ','s','e','g',
-  'm','e','n','t',' ','o','v','e','r','r','i','d','e',' ','e',
-  'x','p','r','e','s','s','i','o','n',#000,'E','_','S','t','r',
-  'i','n','g','s',' ','n','o','t',' ','a','l','l','o','w','e',
-  'd',' ','a','s',' ','c','o','n','s','t','a','n','t','s',#000,
-  'D','_','S','t','a','r','t','i','n','g',' ','A','T','&','T',
+  'g',' ','h','e','x','a','d','e','c','i','m','a','l',#000,'F',
+  '_','I','n','t','e','r','n','a','l',' ','E','r','r','r','o',
+  'r',' ','c','o','n','v','e','r','t','i','n','g',' ','o','c',
+  't','a','l',#000,'E','_','I','n','v','a','l','i','d',' ','c',
+  'o','n','s','t','a','n','t',' ','e','x','p','r','e','s','s',
+  'i','o','n',#000,'E','_','U','n','k','n','o','w','n',' ','i',
+  'd','e','n','t','i','f','i','e','r',':',' ','$','1',#000,'E',
+  '_','T','r','y','i','n','g',' ','t','o',' ','d','e','f','i',
+  'n','e',' ','a','n',' ','i','n','d','e','x',' ','r','e','g',
+  'i','s','t','e','r',' ','m','o','r','e',' ','t','h','a','n',
+  ' ','o','n','c','e',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','f','i','e','l','d',' ','s','p','e','c','i','f','i','e',
+  'r',#000,'F','_','I','n','t','e','r','n','a','l',' ','E','r',
+  'r','o','r',' ','i','n',' ','B','u','i','l','d','S','c','a',
+  'l','i','n','g','(',')',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','s','c','a','l','i','n','g',' ','f','a','c','t','o',
+  'r',#000,'E','_','I','n','v','a','l','i','d',' ','s','c','a',
+  'l','i','n','g',' ','v','a','l','u','e',#000,'E','_','S','c',
+  'a','l','i','n','g',' ','v','a','l','u','e',' ','o','n','l',
+  'y',' ','a','l','l','o','w','e','d',' ','w','i','t','h',' ',
+  'i','n','d','e','x',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','a','s','s','e','m','b','l','e','r',' ','s','y','n','t',
+  'a','x','.',' ','N','o',' ','r','e','f',' ','w','i','t','h',
+  ' ','b','r','a','c','k','e','t','s',')',#000,'E','_','E','x',
+  'p','r','e','s','s','i','o','n','s',' ','o','f',' ','t','h',
+  'e',' ','f','o','r','m',' ','[','s','r','e','g',':','r','e',
+  'g','.','.','.',']',' ','a','r','e',' ','c','u','r','r','e',
+  'n','t','l','y',' ','n','o','t',' ','s','u','p','p','o','r',
+  't','e','d',#000,'E','_','T','r','y','i','n','g',' ','t','o',
+  ' ','d','e','f','i','n','e',' ','a',' ','s','e','g','m','e',
+  'n','t',' ','r','e','g','i','s','t','e','r',' ','t','w','i',
+  'c','e',#000,'E','_','T','r','y','i','n','g',' ','t','o',' ',
+  'd','e','f','i','n','e',' ','a',' ','b','a','s','e',' ','r',
+  'e','g','i','s','t','e','r',' ','t','w','i','c','e',#000,'E',
+  '_','T','r','y','i','n','g',' ','t','o',' ','u','s','e',' ',
+  'a',' ','n','e','g','a','t','i','v','e',' ','i','n','d','e',
+  'x',' ','r','e','g','i','s','t','e','r',#000,'E','_','A','s',
+  'm',' ','s','y','n','t','a','x',' ','e','r','r','o','r',' ',
+  '-',' ','e','r','r','o','r',' ','i','n',' ','r','e','f','e',
+  'r','e','n','c','e',#000,'E','_','L','o','c','a','l',' ','s',
+  'y','m','b','o','l','s',' ','n','o','t',' ','a','l','l','o',
+  'w','e','d',' ','a','s',' ','r','e','f','e','r','e','n','c',
+  'e','s',#000,'E','_','I','n','v','a','l','i','d',' ','o','p',
+  'e','r','a','n','d',' ','i','n',' ','b','r','a','c','k','e',
+  't',' ','e','x','p','r','e','s','s','i','o','n',#000,'E','_',
+  'I','n','v','a','l','i','d',' ','s','y','m','b','o','l',' ',
+  'n','a','m','e',':',' ','$','1',#000,'E','_','I','n','v','a',
+  'l','i','d',' ','R','e','f','e','r','e','n','c','e',' ','s',
+  'y','n','t','a','x',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','s','t','r','i','n','g',' ','a','s',' ','o','p','c','o',
+  'd','e',' ','o','p','e','r','a','n','d',':',' ','$','1',#000,
+  'W','_','@','C','O','D','E',' ','a','n','d',' ','@','D','A',
+  'T','A',' ','n','o','t',' ','s','u','p','p','o','r','t','e',
+  'd',#000,'E','_','N','u','l','l',' ','l','a','b','e','l',' ',
+  'r','e','f','e','r','e','n','c','e','s',' ','a','r','e',' ',
+  'n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_','C',
+  'a','n','n','o','t',' ','u','s','e',' ','S','E','L','F',' ',
+  'o','u','t','s','i','d','e',' ','a',' ','m','e','t','h','o',
+  'd',#000,'E','_','A','s','m',' ','s','y','n','t','a','x',' ',
+  'e','r','r','o','r',' ','-',' ','S','h','o','u','l','d',' ',
+  's','t','a','r','t',' ','w','i','t','h',' ','b','r','a','c',
+  'k','e','t',#000,'E','_','A','s','m',' ','s','y','n','t','a',
+  'x',' ','e','r','r','o','r',' ','-',' ','r','e','g','i','s',
+  't','e','r',':',' ','$','1',#000,'E','_','S','E','G',' ','a',
+  'n','d',' ','O','F','F','S','E','T',' ','n','o','t',' ','s',
+  'u','p','p','o','r','t','e','d',#000,'E','_','A','s','m',' ',
+  's','y','n','t','a','x',' ','e','r','r','o','r',' ','-',' ',
+  'i','n',' ','o','p','c','o','d','e',' ','o','p','e','r','a',
+  'n','d',#000,'E','_','I','n','v','a','l','i','d',' ','S','t',
+  'r','i','n','g',' ','e','x','p','r','e','s','s','i','o','n',
+  #000,'E','_','C','o','n','s','t','a','n','t',' ','e','x','p',
+  'r','e','s','s','i','o','n',' ','o','u','t',' ','o','f',' ',
+  'b','o','u','n','d','s',#000,'F','_','I','n','t','e','r','n',
+  'a','l',' ','E','r','r','o','r',' ','i','n',' ','B','u','i',
+  'l','d','C','o','n','s','t','a','n','t','(',')',#000,'W','_',
+  'A',' ','r','e','p','e','a','t',' ','p','r','e','f','i','x',
+  ' ','a','n','d',' ','a',' ','s','e','g','m','e','n','t',' ',
+  'o','v','e','r','r','i','d','e',' ','o','n',' ','<','=',' ',
+  'i','3','8','6',' ','m','a','y',' ','r','e','s','u','l','t',
+  ' ','i','n',' ','e','r','r','o','r','s',' ','i','f',' ','a',
+  'n',' ','i','n','t','e','r','r','u','p','t',' ','o','c','c',
+  'u','r','s',#000,'E','_','I','n','v','a','l','i','d',' ','o',
+  'r',' ','m','i','s','s','i','n','g',' ','o','p','c','o','d',
+  'e',#000,'E','_','I','n','v','a','l','i','d',' ','c','o','m',
+  'b','i','n','a','t','i','o','n',' ','o','f',' ','p','r','e',
+  'f','i','x',' ','a','n','d',' ','o','p','c','o','d','e',':',
+  ' ','$','1',#000,'E','_','I','n','v','a','l','i','d',' ','c',
+  'o','m','b','i','n','a','t','i','o','n',' ','o','f',' ','o',
+  'v','e','r','r','i','d','e',' ','a','n','d',' ','o','p','c',
+  'o','d','e',':',' ','$','1',#000,'E','_','T','o','o',' ','m',
+  'a','n','y',' ','o','p','e','r','a','n','d','s',' ','o','n',
+  ' ','l','i','n','e',#000,'E','_','D','u','p','l','i','c','a',
+  't','e',' ','l','o','c','a','l',' ','s','y','m','b','o','l',
+  ':',' ','$','1',#000,'E','_','U','n','k','n','o','w','n',' ',
+  'l','a','b','e','l',' ','i','d','e','n','t','i','f','e','r',
+  ':',' ','$','1',#000,'E','_','A','s','s','e','m','b','l','e',
+  ' ','n','o','d','e',' ','s','y','n','t','a','x',' ','e','r',
+  'r','o','r',#000,'E','_','U','n','d','e','f','i','n','e','d',
+  ' ','l','o','c','a','l',' ','s','y','m','b','o','l',':',' ',
+  '$','1',#000,'D','_','S','t','a','r','t','i','n','g',' ','i',
+  'n','t','e','l',' ','s','t','y','l','e','d',' ','a','s','s',
+  'e','m','b','l','e','r',' ','p','a','r','s','i','n','g','.',
+  '.','.',#000,'D','_','F','i','n','i','s','h','e','d',' ','i',
+  'n','t','e','l',' ','s','t','y','l','e','d',' ','a','s','s',
+  'e','m','b','l','e','r',' ','p','a','r','s','i','n','g','.',
+  '.','.',#000,'E','_','N','o','t',' ','a',' ','d','i','r','e',
+  'c','t','i','v','e',' ','o','r',' ','l','o','c','a','l',' ',
+  's','y','m','b','o','l',':',' ','$','1',#000,'E','_','/',' ',
+  'a','t',' ','b','e','g','i','n','n','i','n','g',' ','o','f',
+  ' ','l','i','n','e',' ','n','o','t',' ','a','l','l','o','w',
+  'e','d',#000,'E','_','N','O','R',' ','n','o','t',' ','s','u',
+  'p','p','o','r','t','e','d',#000,'E','_','I','n','v','a','l',
+  'i','d',' ','f','l','o','a','t','i','n','g',' ','p','o','i',
+  'n','t',' ','r','e','g','i','s','t','e','r',' ','n','a','m',
+  'e',#000,'W','_','M','o','d','u','l','o',' ','n','o','t',' ',
+  's','u','p','p','o','r','t','e','d',#000,'E','_','I','n','v',
+  'a','l','i','d',' ','f','l','o','a','t','i','n','g',' ','p',
+  'o','i','n','t',' ','c','o','n','s','t','a','n','t',':',' ',
+  '$','1',#000,'E','_','S','i','z','e',' ','s','u','f','f','i',
+  'x',' ','a','n','d',' ','d','e','s','t','i','n','a','t','i',
+  'o','n',' ','r','e','g','i','s','t','e','r',' ','d','o',' ',
+  'n','o','t',' ','m','a','t','c','h',#000,'E','_','I','n','t',
+  'e','r','n','a','l',' ','e','r','r','o','r',' ','i','n',' ',
+  'C','o','n','c','a','t','L','a','b','e','l','e','d','I','n',
+  's','t','r','(',')',#000,'W','_','F','l','o','a','t','i','n',
+  'g',' ','p','o','i','n','t',' ','b','i','n','a','r','y',' ',
+  'r','e','p','r','e','s','e','n','t','a','t','i','o','n',' ',
+  'i','g','n','o','r','e','d',#000,'W','_','F','l','o','a','t',
+  'i','n','g',' ','p','o','i','n','t',' ','h','e','x','a','d',
+  'e','c','i','m','a','l',' ','r','e','p','r','e','s','e','n',
+  't','a','t','i','o','n',' ','i','g','n','o','r','e','d',#000,
+  'W','_','F','l','o','a','t','i','n','g',' ','p','o','i','n',
+  't',' ','o','c','t','a','l',' ','r','e','p','r','e','s','e',
+  'n','t','a','t','i','o','n',' ','i','g','n','o','r','e','d',
+  #000,'E','_','I','n','v','a','l','i','d',' ','r','e','a','l',
+  ' ','c','o','n','s','t','a','n','t',' ','e','x','p','r','e',
+  's','s','i','o','n',#000,'E','_','P','a','r','e','n','t','h',
+  'e','s','i','s',' ','a','r','e',' ','n','o','t',' ','a','l',
+  'l','o','w','e','d',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','R','e','f','e','r','e','n','c','e',#000,'E','_','C','a',
+  'n','n','o','t',' ','u','s','e',' ','_','_','S','E','L','F',
+  ' ','o','u','t','s','i','d','e',' ','a',' ','m','e','t','h',
+  'o','d',#000,'E','_','C','a','n','n','o','t',' ','u','s','e',
+  ' ','_','_','O','L','D','E','B','P',' ','o','u','t','s','i',
+  'd','e',' ','a',' ','n','e','s','t','e','d',' ','p','r','o',
+  'c','e','d','u','r','e',#000,'W','_','I','d','e','n','t','i',
+  'f','i','e','r',' ','$','1',' ','s','u','p','p','o','s','e',
+  'd',' ','e','x','t','e','r','n','a','l',#000,'E','_','I','n',
+  'v','a','l','i','d',' ','s','e','g','m','e','n','t',' ','o',
+  'v','e','r','r','i','d','e',' ','e','x','p','r','e','s','s',
+  'i','o','n',#000,'E','_','S','t','r','i','n','g','s',' ','n',
+  'o','t',' ','a','l','l','o','w','e','d',' ','a','s',' ','c',
+  'o','n','s','t','a','n','t','s',#000,'D','_','S','t','a','r',
+  't','i','n','g',' ','A','T','&','T',' ','s','t','y','l','e',
+  'd',' ','a','s','s','e','m','b','l','e','r',' ','p','a','r',
+  's','i','n','g','.','.','.',#000,'D','_','F','i','n','i','s',
+  'h','e','d',' ','A','T','&','T',' ','s','t','y','l','e','d',
+  ' ','a','s','s','e','m','b','l','e','r',' ','p','a','r','s',
+  'i','n','g','.','.','.',#000,'E','_','S','w','i','t','c','h',
+  'i','n','g',' ','s','e','c','t','i','o','n','s',' ','i','s',
+  ' ','n','o','t',' ','a','l','l','o','w','e','d',' ','i','n',
+  ' ','a','n',' ','a','s','s','e','m','b','l','e','r',' ','b',
+  'l','o','c','k',#000,'E','_','I','n','v','a','l','i','d',' ',
+  'g','l','o','b','a','l',' ','d','e','f','i','n','i','t','i',
+  'o','n',#000,'E','_','L','i','n','e',' ','s','e','p','a','r',
+  'a','t','o','r',' ','e','x','p','e','c','t','e','d',#000,'W',
+  '_','g','l','o','b','l',' ','n','o','t',' ','s','u','p','p',
+  'o','r','t','e','d',#000,'W','_','a','l','i','g','n',' ','n',
+  'o','t',' ','s','u','p','p','o','r','t','e','d',#000,'W','_',
+  'l','c','o','m','m',' ','n','o','t',' ','s','u','p','p','o',
+  'r','t','e','d',#000,'W','_','c','o','m','m',' ','n','o','t',
+  ' ','s','u','p','p','o','r','t','e','d',#000,'E','_','I','n',
+  'v','a','l','i','d',' ','l','o','c','a','l',' ','c','o','m',
+  'm','o','n',' ','d','e','f','i','n','i','t','i','o','n',#000,
+  'E','_','I','n','v','a','l','i','d',' ','g','l','o','b','a',
+  'l',' ','c','o','m','m','o','n',' ','d','e','f','i','n','i',
+  't','i','o','n',#000,'E','_','l','o','c','a','l',' ','s','y',
+  'm','b','o','l',':',' ','$','1',' ','n','o','t',' ','f','o',
+  'u','n','d',' ','i','n','s','i','d','e',' ','a','s','m',' ',
+  's','t','a','t','e','m','e','n','t',#000,'E','_','a','s','s',
+  'e','m','b','l','e','r',' ','c','o','d','e',' ','n','o','t',
+  ' ','r','e','t','u','r','n','e','d',' ','t','o',' ','t','e',
+  'x','t',#000,'F','_','i','n','t','e','r','n','a','l',' ','e',
+  'r','r','o','r',' ','i','n',' ','B','u','i','l','d','R','e',
+  'f','e','r','e','n','c','e','(',')',#000,'E','_','i','n','v',
+  'a','l','i','d',' ','o','p','c','o','d','e',' ','s','i','z',
+  'e',#000,'W','_','N','E','A','R',' ','i','g','n','o','r','e',
+  'd',#000,'W','_','F','A','R',' ','i','g','n','o','r','e','d',
+  #000,'D','_','C','r','e','a','t','i','n','g',' ','i','n','l',
+  'i','n','e',' ','a','s','m',' ','l','o','o','k','u','p',' ',
+  't','a','b','l','e','s',#000,'W','_','U','s','i','n','g',' ',
+  'a',' ','d','e','f','i','n','e','d',' ','n','a','m','e',' ',
+  'a','s',' ','a',' ','l','o','c','a','l',' ','l','a','b','e',
+  'l',#000,'F','_','i','n','t','e','r','n','a','l',' ','e','r',
+  'r','o','r',' ','i','n',' ','H','a','n','d','l','e','E','x',
+  't','e','n','d','(',')',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','c','h','a','r','a','c','t','e','r',':',' ','<',#000,
+  'E','_','I','n','v','a','l','i','d',' ','c','h','a','r','a',
+  'c','t','e','r',':',' ','>',#000,'E','_','U','n','s','u','p',
+  'p','o','r','t','e','d',' ','o','p','c','o','d','e',#000,'E',
+  '_','I','n','c','r','e','m','e','n','t',' ','a','n','d',' ',
+  'D','e','c','r','e','m','e','n','t',' ','m','o','d','e',' ',
+  'n','o','t',' ','a','l','l','o','w','e','d',' ','t','o','g',
+  'e','t','h','e','r',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','R','e','g','i','s','t','e','r',' ','l','i','s','t',' ',
+  'i','n',' ','m','o','v','e','m','/','f','m','o','v','e','m',
+  #000,'E','_','I','n','v','a','l','i','d',' ','R','e','g','i',
+  's','t','e','r',' ','l','i','s','t',' ','f','o','r',' ','o',
+  'p','c','o','d','e',#000,'E','_','6','8','0','2','0','+',' ',
+  'm','o','d','e',' ','r','e','q','u','i','r','e','d',' ','t',
+  'o',' ','a','s','s','e','m','b','l','e',#000,'D','_','S','t',
+  'a','r','t','i','n','g',' ','M','o','t','o','r','o','l','a',
   ' ','s','t','y','l','e','d',' ','a','s','s','e','m','b','l',
   'e','r',' ','p','a','r','s','i','n','g','.','.','.',#000,'D',
-  '_','F','i','n','i','s','h','e','d',' ','A','T','&','T',' ',
-  's','t','y','l','e','d',' ','a','s','s','e','m','b','l','e',
-  'r',' ','p','a','r','s','i','n','g','.','.','.',#000,'E','_',
-  'S','w','i','t','c','h','i','n','g',' ','s','e','c','t','i',
-  'o','n','s',' ','i','s',' ','n','o','t',' ','a','l','l','o',
-  'w','e','d',' ','i','n',' ','a','n',' ','a','s','s','e','m',
-  'b','l','e','r',' ','b','l','o','c','k',#000,'E','_','I','n',
-  'v','a','l','i','d',' ','g','l','o','b','a','l',' ','d','e',
-  'f','i','n','i','t','i','o','n',#000,'E','_','L','i','n','e',
-  ' ','s','e','p','a','r','a','t','o','r',' ','e','x','p','e',
-  'c','t','e','d',#000,'W','_','g','l','o','b','l',' ','n','o',
-  't',' ','s','u','p','p','o','r','t','e','d',#000,'W','_','a',
-  'l','i','g','n',' ','n','o','t',' ','s','u','p','p','o','r',
-  't','e','d',#000,'W','_','l','c','o','m','m',' ','n','o','t',
-  ' ','s','u','p','p','o','r','t','e','d',#000,'W','_','c','o',
-  'm','m',' ','n','o','t',' ','s','u','p','p','o','r','t','e',
-  'd',#000,'E','_','I','n','v','a','l','i','d',' ','l','o','c',
-  'a','l',' ','c','o','m','m','o','n',' ','d','e','f','i','n',
-  'i','t','i','o','n',#000,'E','_','I','n','v','a','l','i','d',
-  ' ','g','l','o','b','a','l',' ','c','o','m','m','o','n',' ',
-  'd','e','f','i','n','i','t','i','o','n',#000,'E','_','l','o',
-  'c','a','l',' ','s','y','m','b','o','l',':',' ','$','1',' ',
-  'n','o','t',' ','f','o','u','n','d',' ','i','n','s','i','d',
-  'e',' ','a','s','m',' ','s','t','a','t','e','m','e','n','t',
-  #000,'E','_','a','s','s','e','m','b','l','e','r',' ','c','o',
-  'd','e',' ','n','o','t',' ','r','e','t','u','r','n','e','d',
-  ' ','t','o',' ','t','e','x','t',#000,'F','_','i','n','t','e',
-  'r','n','a','l',' ','e','r','r','o','r',' ','i','n',' ','B',
-  'u','i','l','d','R','e','f','e','r','e','n','c','e','(',')',
-  #000,'E','_','i','n','v','a','l','i','d',' ','o','p','c','o',
-  'd','e',' ','s','i','z','e',#000,'W','_','N','E','A','R',' ',
-  'i','g','n','o','r','e','d',#000,'W','_','F','A','R',' ','i',
-  'g','n','o','r','e','d',#000,'D','_','C','r','e','a','t','i',
-  'n','g',' ','i','n','l','i','n','e',' ','a','s','m',' ','l',
-  'o','o','k','u','p',' ','t','a','b','l','e','s',#000,'W','_',
-  'U','s','i','n','g',' ','a',' ','d','e','f','i','n','e','d',
-  ' ','n','a','m','e',' ','a','s',' ','a',' ','l','o','c','a',
-  'l',' ','l','a','b','e','l',#000,'F','_','i','n','t','e','r',
-  'n','a','l',' ','e','r','r','o','r',' ','i','n',' ','H','a',
-  'n','d','l','e','E','x','t','e','n','d','(',')',#000,'E','_',
-  'I','n','v','a','l','i','d',' ','c','h','a','r','a','c','t',
-  'e','r',':',' ','<',#000,'E','_','I','n','v','a','l','i','d',
-  ' ','c','h','a','r','a','c','t','e','r',':',' ','>',#000,'E',
-  '_','U','n','s','u','p','p','o','r','t','e','d',' ','o','p',
-  'c','o','d','e',#000,'E','_','I','n','c','r','e','m','e','n',
-  't',' ','a','n','d',' ','D','e','c','r','e','m','e','n','t',
-  ' ','m','o','d','e',' ','n','o','t',' ','a','l','l','o','w',
-  'e','d',' ','t','o','g','e','t','h','e','r',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','R','e','g','i','s','t','e','r',
-  ' ','l','i','s','t',' ','i','n',' ','m','o','v','e','m','/',
-  'f','m','o','v','e','m',#000,'E','_','I','n','v','a','l','i',
-  'd',' ','R','e','g','i','s','t','e','r',' ','l','i','s','t',
-  ' ','f','o','r',' ','o','p','c','o','d','e',#000,'E','_','6',
-  '8','0','2','0','+',' ','m','o','d','e',' ','r','e','q','u',
-  'i','r','e','d',' ','t','o',' ','a','s','s','e','m','b','l',
-  'e',#000,'D','_','S','t','a','r','t','i','n','g',' ','M','o',
-  't','o','r','o','l','a',' ','s','t','y','l','e','d',' ','a',
-  's','s','e','m','b','l','e','r',' ','p','a','r','s','i','n',
-  'g','.','.','.',#000,'D','_','F','i','n','i','s','h','e','d',
-  ' ','M','o','t','o','r','o','l','a',' ','s','t','y','l','e',
-  'd',' ','a','s','s','e','m','b','l','e','r',' ','p','a','r',
-  's','i','n','g','.','.','.',#000,'W','_','X','D','E','F',' ',
-  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'W',
-  '_','F','u','n','c','t','i','o','n','s',' ','w','i','t','h',
-  ' ','v','o','i','d',' ','r','e','t','u','r','n',' ','v','a',
-  'l','u','e',' ','c','a','n',#039,'t',' ','r','e','t','u','r',
-  'n',' ','a','n','y',' ','v','a','l','u','e',' ','i','n',' ',
-  'a','s','m',' ','c','o','d','e',#000,'E','_','I','n','v','a',
-  'l','i','d',' ','s','u','f','f','i','x',' ','f','o','r',' ',
-  'i','n','t','e','l',' ','a','s','s','e','m','b','l','e','r',
-  #000,'E','_','E','x','t','e','n','d','e','d',' ','n','o','t',
-  ' ','s','u','p','p','o','r','t','e','d',' ','i','n',' ','t',
-  'h','i','s',' ','m','o','d','e',#000,'E','_','C','o','m','p',
-  ' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',' ',
-  'i','n',' ','t','h','i','s',' ','m','o','d','e',#000,'W','_',
-  'Y','o','u',' ','n','e','e','d',' ','G','N','U',' ','a','s',
-  ' ','v','e','r','s','i','o','n',' ','>','=',' ','2','.','8',
-  '1',' ','t','o',' ','c','o','m','p','i','l','e',' ','t','h',
-  'i','s',' ','M','M','X',' ','c','o','d','e',#000,'I','_','A',
-  's','s','e','m','b','l','i','n','g',' ','(','p','i','p','e',
-  ')',' ','$','1',#000,'E','_','C','a','n',#039,'t',' ','c','r',
-  'e','a','t','e',' ','a','s','s','e','m','b','e','r',' ','f',
-  'i','l','e',' ','$','1',#000,'W','_','A','s','s','e','m','b',
-  'l','e','r',' ','$','1',' ','n','o','t',' ','f','o','u','n',
-  'd',',',' ','s','w','i','t','c','h','i','n','g',' ','t','o',
-  ' ','e','x','t','e','r','n','a','l',' ','a','s','s','e','m',
-  'b','l','i','n','g',#000,'U','_','U','s','i','n','g',' ','a',
-  's','s','e','m','b','l','e','r',':',' ','$','1',#000,'W','_',
-  'E','r','r','o','r',' ','w','h','i','l','e',' ','a','s','s',
-  'e','m','b','l','i','n','g',#000,'W','_','C','a','n',#039,'t',
-  ' ','c','a','l','l',' ','t','h','e',' ','a','s','s','e','m',
-  'b','l','e','r',',',' ','s','w','i','t','c','h','i','n','g',
-  ' ','t','o',' ','e','x','t','e','r','n','a','l',' ','a','s',
-  's','e','m','b','l','i','n','g',#000,'I','_','A','s','s','e',
-  'm','b','l','i','n','g',' ','$','1',#000,'W','_','L','i','n',
-  'k','e','r',' ','$','1',' ','n','o','t',' ','f','o','u','n',
-  'd',',',' ','s','w','i','t','c','h','i','n','g',' ','t','o',
-  ' ','e','x','t','e','r','n','a','l',' ','l','i','n','k','i',
-  'n','g',#000,'U','_','U','s','i','n','g',' ','l','i','n','k',
-  'e','r',':',' ','$','1',#000,'E','_','F','i','l','e',' ','$',
-  '1',' ','n','o','t',' ','f','o','u','n','d',',',' ','L','i',
-  'n','k','i','n','g',' ','m','a','y',' ','f','a','i','l',' ',
-  '!','!',#000,'W','_','E','r','r','o','r',' ','w','h','i','l',
-  'e',' ','l','i','n','k','i','n','g',#000,'W','_','C','a','n',
-  #039,'t',' ','c','a','l','l',' ','t','h','e',' ','l','i','n',
-  'k','e','r',',',' ','s','w','i','t','c','h','i','n','g',' ',
-  't','o',' ','e','x','t','e','r','n','a','l',' ','l','i','n',
-  'k','i','n','g',#000,'I','_','L','i','n','k','i','n','g',' ',
-  '$','1',#000,'W','_','b','i','n','d','e','r',' ','n','o','t',
-  ' ','f','o','u','n','d',',',' ','s','w','i','t','c','h','i',
-  'n','g',' ','t','o',' ','e','x','t','e','r','n','a','l',' ',
-  'b','i','n','d','i','n','g',#000,'W','_','a','r',' ','n','o',
-  't',' ','f','o','u','n','d',',',' ','s','w','i','t','c','h',
-  'i','n','g',' ','t','o',' ','e','x','t','e','r','n','a','l',
-  ' ','a','r',#000,'E','_','D','y','n','a','m','i','c',' ','L',
-  'i','b','r','a','r','i','e','s',' ','n','o','t',' ','s','u',
-  'p','p','o','r','t','e','d',#000,'I','_','C','l','o','s','i',
-  'n','g',' ','s','c','r','i','p','t',' ','$','1',#000,'U','_',
-  'P','P','U',' ','L','o','a','d','i','n','g',' ','$','1',#000,
-  'D','_','P','P','U',' ','T','i','m','e',':',' ','$','1',#000,
-  'D','_','P','P','U',' ','F','i','l','e',' ','t','o','o',' ',
-  's','h','o','r','t',#000,'D','_','P','P','U',' ','I','n','v',
-  'a','l','i','d',' ','H','e','a','d','e','r',' ','(','n','o',
-  ' ','P','P','U',' ','a','t',' ','t','h','e',' ','b','e','g',
-  'i','n',')',#000,'D','_','P','P','U',' ','I','n','v','a','l',
-  'i','d',' ','V','e','r','s','i','o','n',' ','$','1',#000,'D',
-  '_','P','P','U',' ','F','l','a','g','s',':',' ','$','1',#000,
-  'D','_','P','P','U',' ','C','r','c',':',' ','$','1',#000,'T',
-  '_','P','P','U',' ','S','o','u','r','c','e',':',' ','$','1',
-  #000,'D','_','o','b','j','e','c','t','f','i','l','e',' ','a',
-  'n','d',' ','a','s','s','e','m','b','l','e','r','f','i','l',
-  'e',' ','a','r','e',' ','o','l','d','e','r',' ','t','h','a',
-  'n',' ','p','p','u','f','i','l','e',#000,'D','_','o','b','j',
-  'e','c','t','f','i','l','e',' ','i','s',' ','o','l','d','e',
-  'r',' ','t','h','a','n',' ','a','s','s','e','m','b','l','e',
-  'r','f','i','l','e',#000,'T','_','U','n','i','t','s','e','a',
-  'r','c','h',':',' ','$','1',#000,'U','_','W','r','i','t','i',
-  'n','g',' ','$','1',#000,'F','_','C','a','n',#039,'t',' ','W',
-  'r','i','t','e',' ','P','P','U','-','F','i','l','e',#000,'F',
-  '_','r','e','a','d','i','n','g',' ','P','P','U','-','F','i',
-  'l','e',#000,'F','_','I','n','v','a','l','i','d',' ','P','P',
-  'U','-','F','i','l','e',' ','e','n','t','r','y',':',' ','$',
-  '1',#000,'F','_','P','P','U',' ','D','b','x',' ','c','o','u',
-  'n','t',' ','p','r','o','b','l','e','m',#000,'E','_','I','l',
-  'l','e','g','a','l',' ','u','n','i','t',' ','n','a','m','e',
-  ':',' ','$','1',#000,'F','_','T','o','o',' ','m','u','c','h',
-  ' ','u','n','i','t','s',#000,'F','_','C','i','r','c','u','l',
-  'a','r',' ','u','n','i','t',' ','r','e','f','e','r','e','n',
-  'c','e',#000,'F','_','C','a','n',#039,'t',' ','c','o','m','p',
-  'i','l','e',' ','u','n','i','t',' ','$','1',',',' ','n','o',
-  ' ','s','o','u','r','c','e','s',' ','a','v','a','i','l','a',
-  'b','l','e',#000,'W','_','C','o','m','p','i','l','i','n','g',
-  ' ','t','h','e',' ','s','y','s','t','e','m',' ','u','n','i',
-  't',' ','r','e','q','u','i','r','e','s',' ','t','h','e',' ',
-  '-','U','s',' ','s','w','i','t','c','h',#000,'E','_','$','1',
-  ' ','E','r','r','o','r','s',#000,'F','_','T','h','e','r','e',
-  ' ','w','e','r','e',' ','e','r','r','o','r','s',' ','c','o',
-  'm','p','i','l','i','n','g',' ','m','o','d','u','l','e',',',
-  ' ','c','o','m','p','i','l','a','t','i','o','n',' ','s','t',
-  'o','p','p','e','d',#000);
+  '_','F','i','n','i','s','h','e','d',' ','M','o','t','o','r',
+  'o','l','a',' ','s','t','y','l','e','d',' ','a','s','s','e',
+  'm','b','l','e','r',' ','p','a','r','s','i','n','g','.','.',
+  '.',#000,'W','_','X','D','E','F',' ','n','o','t',' ','s','u',
+  'p','p','o','r','t','e','d',#000,'W','_','F','u','n','c','t',
+  'i','o','n','s',' ','w','i','t','h',' ','v','o','i','d',' ',
+  'r','e','t','u','r','n',' ','v','a','l','u','e',' ','c','a',
+  'n',#039,'t',' ','r','e','t','u','r','n',' ','a','n','y',' ',
+  'v','a','l','u','e',' ','i','n',' ','a','s','m',' ','c','o',
+  'd','e',#000,'E','_','I','n','v','a','l','i','d',' ','s','u',
+  'f','f','i','x',' ','f','o','r',' ','i','n','t','e','l',' ',
+  'a','s','s','e','m','b','l','e','r',#000,'E','_','E','x','t',
+  'e','n','d','e','d',' ','n','o','t',' ','s','u','p','p','o',
+  'r','t','e','d',' ','i','n',' ','t','h','i','s',' ','m','o',
+  'd','e',#000,'E','_','C','o','m','p',' ','n','o','t',' ','s',
+  'u','p','p','o','r','t','e','d',' ','i','n',' ','t','h','i',
+  's',' ','m','o','d','e',#000,'W','_','Y','o','u',' ','n','e',
+  'e','d',' ','G','N','U',' ','a','s',' ','v','e','r','s','i',
+  'o','n',' ','>','=',' ','2','.','8','1',' ','t','o',' ','c',
+  'o','m','p','i','l','e',' ','t','h','i','s',' ','M','M','X',
+  ' ','c','o','d','e',#000,'I','_','A','s','s','e','m','b','l',
+  'i','n','g',' ','(','p','i','p','e',')',' ','$','1',#000,'E',
+  '_','C','a','n',#039,'t',' ','c','r','e','a','t','e',' ','a',
+  's','s','e','m','b','e','r',' ','f','i','l','e',' ','$','1',
+  #000,'W','_','A','s','s','e','m','b','l','e','r',' ','$','1',
+  ' ','n','o','t',' ','f','o','u','n','d',',',' ','s','w','i',
+  't','c','h','i','n','g',' ','t','o',' ','e','x','t','e','r',
+  'n','a','l',' ','a','s','s','e','m','b','l','i','n','g',#000,
+  'U','_','U','s','i','n','g',' ','a','s','s','e','m','b','l',
+  'e','r',':',' ','$','1',#000,'W','_','E','r','r','o','r',' ',
+  'w','h','i','l','e',' ','a','s','s','e','m','b','l','i','n',
+  'g',#000,'W','_','C','a','n',#039,'t',' ','c','a','l','l',' ',
+  't','h','e',' ','a','s','s','e','m','b','l','e','r',',',' ',
+  's','w','i','t','c','h','i','n','g',' ','t','o',' ','e','x',
+  't','e','r','n','a','l',' ','a','s','s','e','m','b','l','i',
+  'n','g',#000,'I','_','A','s','s','e','m','b','l','i','n','g',
+  ' ','$','1',#000,'W','_','L','i','n','k','e','r',' ','$','1',
+  ' ','n','o','t',' ','f','o','u','n','d',',',' ','s','w','i',
+  't','c','h','i','n','g',' ','t','o',' ','e','x','t','e','r',
+  'n','a','l',' ','l','i','n','k','i','n','g',#000,'U','_','U',
+  's','i','n','g',' ','l','i','n','k','e','r',':',' ','$','1',
+  #000,'W','_','O','b','j','e','c','t',' ','$','1',' ','n','o',
+  't',' ','f','o','u','n','d',',',' ','L','i','n','k','i','n',
+  'g',' ','m','a','y',' ','f','a','i','l',' ','!',#000,'W','_',
+  'L','i','b','r','a','r','y',' ','$','1',' ','n','o','t',' ',
+  'f','o','u','n','d',',',' ','L','i','n','k','i','n','g',' ',
+  'm','a','y',' ','f','a','i','l',' ','!',#000,'W','_','E','r',
+  'r','o','r',' ','w','h','i','l','e',' ','l','i','n','k','i',
+  'n','g',#000,'W','_','C','a','n',#039,'t',' ','c','a','l','l',
+  ' ','t','h','e',' ','l','i','n','k','e','r',',',' ','s','w',
+  'i','t','c','h','i','n','g',' ','t','o',' ','e','x','t','e',
+  'r','n','a','l',' ','l','i','n','k','i','n','g',#000,'I','_',
+  'L','i','n','k','i','n','g',' ','$','1',#000,'W','_','b','i',
+  'n','d','e','r',' ','n','o','t',' ','f','o','u','n','d',',',
+  ' ','s','w','i','t','c','h','i','n','g',' ','t','o',' ','e',
+  'x','t','e','r','n','a','l',' ','b','i','n','d','i','n','g',
+  #000,'W','_','a','r',' ','n','o','t',' ','f','o','u','n','d',
+  ',',' ','s','w','i','t','c','h','i','n','g',' ','t','o',' ',
+  'e','x','t','e','r','n','a','l',' ','a','r',#000,'E','_','D',
+  'y','n','a','m','i','c',' ','L','i','b','r','a','r','i','e',
+  's',' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',
+  #000,'I','_','C','l','o','s','i','n','g',' ','s','c','r','i',
+  'p','t',' ','$','1',#000,'U','_','P','P','U',' ','L','o','a',
+  'd','i','n','g',' ','$','1',#000,'D','_','P','P','U',' ','T',
+  'i','m','e',':',' ','$','1',#000,'D','_','P','P','U',' ','F',
+  'i','l','e',' ','t','o','o',' ','s','h','o','r','t',#000,'D',
+  '_','P','P','U',' ','I','n','v','a','l','i','d',' ','H','e',
+  'a','d','e','r',' ','(','n','o',' ','P','P','U',' ','a','t',
+  ' ','t','h','e',' ','b','e','g','i','n',')',#000,'D','_','P',
+  'P','U',' ','I','n','v','a','l','i','d',' ','V','e','r','s',
+  'i','o','n',' ','$','1',#000,'D','_','P','P','U',' ','F','l',
+  'a','g','s',':',' ','$','1',#000,'D','_','P','P','U',' ','C',
+  'r','c',':',' ','$','1',#000,'T','_','P','P','U',' ','S','o',
+  'u','r','c','e',':',' ','$','1',#000,'D','_','o','b','j','e',
+  'c','t','f','i','l','e',' ','a','n','d',' ','a','s','s','e',
+  'm','b','l','e','r','f','i','l','e',' ','a','r','e',' ','o',
+  'l','d','e','r',' ','t','h','a','n',' ','p','p','u','f','i',
+  'l','e',#000,'D','_','o','b','j','e','c','t','f','i','l','e',
+  ' ','i','s',' ','o','l','d','e','r',' ','t','h','a','n',' ',
+  'a','s','s','e','m','b','l','e','r','f','i','l','e',#000,'T',
+  '_','U','n','i','t','s','e','a','r','c','h',':',' ','$','1',
+  #000,'U','_','W','r','i','t','i','n','g',' ','$','1',#000,'F',
+  '_','C','a','n',#039,'t',' ','W','r','i','t','e',' ','P','P',
+  'U','-','F','i','l','e',#000,'F','_','r','e','a','d','i','n',
+  'g',' ','P','P','U','-','F','i','l','e',#000,'F','_','I','n',
+  'v','a','l','i','d',' ','P','P','U','-','F','i','l','e',' ',
+  'e','n','t','r','y',':',' ','$','1',#000,'F','_','P','P','U',
+  ' ','D','b','x',' ','c','o','u','n','t',' ','p','r','o','b',
+  'l','e','m',#000,'E','_','I','l','l','e','g','a','l',' ','u',
+  'n','i','t',' ','n','a','m','e',':',' ','$','1',#000,'F','_',
+  'T','o','o',' ','m','u','c','h',' ','u','n','i','t','s',#000,
+  'F','_','C','i','r','c','u','l','a','r',' ','u','n','i','t',
+  ' ','r','e','f','e','r','e','n','c','e',#000,'F','_','C','a',
+  'n',#039,'t',' ','c','o','m','p','i','l','e',' ','u','n','i',
+  't',' ','$','1',',',' ','n','o',' ','s','o','u','r','c','e',
+  's',' ','a','v','a','i','l','a','b','l','e',#000,'W','_','C',
+  'o','m','p','i','l','i','n','g',' ','t','h','e',' ','s','y',
+  's','t','e','m',' ','u','n','i','t',' ','r','e','q','u','i',
+  'r','e','s',' ','t','h','e',' ','-','U','s',' ','s','w','i',
+  't','c','h',#000,'E','_','$','1',' ','E','r','r','o','r','s',
+  #000,'F','_','T','h','e','r','e',' ','w','e','r','e',' ','e',
+  'r','r','o','r','s',' ','c','o','m','p','i','l','i','n','g',
+  ' ','m','o','d','u','l','e',',',' ','c','o','m','p','i','l',
+  'a','t','i','o','n',' ','s','t','o','p','p','e','d',#000);

+ 5 - 19
compiler/os2_targ.pas

@@ -262,7 +262,7 @@ const   ar_magic:array[1..8] of char='!<arch>'#10;
 
 begin
     seq_no:=1;
-    Linker.AddLibraryFile(s+'.dll');
+    Linker.AddSharedLibrary(s+'.dll');
     current_module^.linkofiles.insert(s+'.dll');
     assign(out_file,s+'.ao2');
     rewrite(out_file,1);
@@ -353,23 +353,9 @@ end.
 
 {
   $Log$
-  Revision 1.1  1998-03-25 11:18:15  root
-  Initial revision
-
-  Revision 1.15  1998/03/10 01:17:21  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.14  1998/03/02 23:08:41  florian
-    * the concatcopy bug removed (solves problems when compilg sysatari!)
-
-  Revision 1.13  1998/03/02 13:38:40  peter
-    + importlib object
-    * doesn't crash on a systemunit anymore
-    * updated makefile and depend
-
-  Revision 1.11  1998/02/28 00:20:27  florian
-    * more changes to get import libs for Win32 working
+  Revision 1.2  1998-05-04 17:54:27  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
 
 }

+ 20 - 369
compiler/parser.pas

@@ -230,14 +230,9 @@ unit parser;
          { first, we assume a program }
          if not(assigned(current_module)) then
            begin
-{!!!}
               current_module:=new(pmodule,init(filename,false));
               main_module:=current_module;
            end;
-         { reset flags }
-         current_module^.flags:=0;
-         { ... and crc }
-         current_module^.crc:=0;
 
          { save scanner state }
          oldmacros:=macros;
@@ -411,22 +406,28 @@ unit parser;
 
              GenerateAsm(filename);
 
+           { add the files for the linker from current_module}
+             addlinkerfiles(current_module);
+
+             if smartlink then
+              begin
+                Linker.SetLibName(FileName);
+                Linker.MakeStaticLibrary(SmartLinkPath(FileName));
+              end;
+
              { Check linking  => we are at first level in compile }
              if (compile_level=1) then
               begin
-                if Linker.ExeName='' then
-                 Linker.SetFileName(FileName);
-                if (comp_unit) then
-                 begin
-                   Linker.Make_Library;
-                 end
-                else
+                if not comp_unit then
                  begin
                    if (cs_no_linking in initswitches) then
                     externlink:=true;
-                   Linker.Link;
+                   if Linker.ExeName='' then
+                    Linker.SetExeName(FileName);
+                   Linker.MakeExecutable;
                  end;
               end;
+
            end
          else
            begin
@@ -536,7 +537,12 @@ done:
 end.
 {
   $Log$
-  Revision 1.11  1998-05-01 16:38:45  florian
+  Revision 1.12  1998-05-04 17:54:28  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.11  1998/05/01 16:38:45  florian
     * handling of private and protected fixed
     + change_keywords_to_tp implemented to remove
       keywords which aren't supported by tp
@@ -586,361 +592,6 @@ end.
   Revision 1.3  1998/04/07 22:45:04  florian
     * bug0092, bug0115 and bug0121 fixed
     + packed object/class/array
-
-  Revision 1.2  1998/03/26 11:18:30  florian
-    - switch -Sa removed
-    - support of a:=b:=0 removed
-
-  Revision 1.1.1.1  1998/03/25 11:18:12  root
-  * Restored version
-
-  Revision 1.60  1998/03/24 21:48:32  florian
-    * just a couple of fixes applied:
-         - problem with fixed16 solved
-         - internalerror 10005 problem fixed
-         - patch for assembler reading
-         - small optimizer fix
-         - mem is now supported
-
-  Revision 1.59  1998/03/20 23:31:33  florian
-    * bug0113 fixed
-    * problem with interdepened units fixed ("options.pas problem")
-    * two small extensions for future AMD 3D support
-
-  Revision 1.58  1998/03/13 22:45:58  florian
-    * small bug fixes applied
-
-  Revision 1.57  1998/03/10 17:19:29  peter
-    * fixed bug0108
-    * better linebreak scanning (concentrated in nextchar(), it supports
-      #10, #13, #10#13, #13#10
-
-  Revision 1.56  1998/03/10 16:27:40  pierre
-    * better line info in stabs debug
-    * symtabletype and lexlevel separated into two fields of tsymtable
-    + ifdef MAKELIB for direct library output, not complete
-    + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
-      working
-    + ifdef TESTFUNCRET for setting func result in underfunction, not
-      working
-
-  Revision 1.55  1998/03/10 12:54:06  peter
-    * def_symbol renamed to def_macro and use it in defines_macros
-
-  Revision 1.54  1998/03/10 01:17:22  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.53  1998/03/06 00:52:34  peter
-    * replaced all old messages from errore.msg, only ExtDebug and some
-      Comment() calls are left
-    * fixed options.pas
-
-  Revision 1.52  1998/03/02 16:00:37  peter
-    * -Ch works again
-
-  Revision 1.51  1998/03/02 13:38:44  peter
-    + importlib object
-    * doesn't crash on a systemunit anymore
-    * updated makefile and depend
-
-  Revision 1.49  1998/02/28 00:20:31  florian
-    * more changes to get import libs for Win32 working
-
-  Revision 1.48  1998/02/27 22:27:56  florian
-    + win_targ unit
-    + support of sections
-    + new asmlists: sections, exports and resource
-
-  Revision 1.47  1998/02/24 10:29:17  peter
-    * -a works again
-
-  Revision 1.46  1998/02/24 00:19:14  peter
-    * makefile works again (btw. linux does like any char after a \ )
-    * removed circular unit with assemble and files
-    * fixed a sigsegv in pexpr
-    * pmodule init unit/program is the almost the same, merged them
-
-  Revision 1.45  1998/02/22 23:03:25  peter
-    * renamed msource->mainsource and name->unitname
-    * optimized filename handling, filename is not seperate anymore with
-      path+name+ext, this saves stackspace and a lot of fsplit()'s
-    * recompiling of some units in libraries fixed
-    * shared libraries are working again
-    + $LINKLIB <lib> to support automatic linking to libraries
-    + libraries are saved/read from the ppufile, also allows more libraries
-      per ppufile
-
-  Revision 1.44  1998/02/19 00:11:04  peter
-    * fixed -g to work again
-    * fixed some typos with the scriptobject
-
-  Revision 1.43  1998/02/18 13:48:12  michael
-  + Implemented an OS independent AsmRes object.
-
-  Revision 1.42  1998/02/17 21:20:54  peter
-    + Script unit
-    + __EXIT is called again to exit a program
-    - target_info.link/assembler calls
-    * linking works again for dos
-    * optimized a few filehandling functions
-    * fixed stabs generation for procedures
-
-  Revision 1.41  1998/02/16 12:51:35  michael
-  + Implemented linker object
-
-  Revision 1.40  1998/02/15 21:16:25  peter
-    * all assembler outputs supported by assemblerobject
-    * cleanup with assembleroutputs, better .ascii generation
-    * help_constructor/destructor are now added to the externals
-    - generation of asmresponse is not outputformat depended
-
-  Revision 1.39  1998/02/14 01:45:26  peter
-    * more fixes
-    - pmode target is removed
-    - search_as_ld is removed, this is done in the link.pas/assemble.pas
-    + findexe() to search for an executable (linker,assembler,binder)
-
-  Revision 1.38  1998/02/13 22:26:33  peter
-    * fixed a few SigSegv's
-    * INIT$$ was not written for linux!
-    * assembling and linking works again for linux and dos
-    + assembler object, only attasmi3 supported yet
-    * restore pp.pas with AddPath etc.
-
-  Revision 1.37  1998/02/13 10:35:17  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
-  Revision 1.36  1998/02/12 17:19:12  florian
-    * fixed to get remake3 work, but needs additional fixes (output, I don't like
-      also that aktswitches isn't a pointer)
-
-  Revision 1.35  1998/02/12 11:50:16  daniel
-  Yes! Finally! After three retries, my patch!
-
-  Changes:
-
-  Complete rewrite of psub.pas.
-  Added support for DLL's.
-  Compiler requires less memory.
-  Platform units for each platform.
-
-  Revision 1.34  1998/02/02 11:47:36  pierre
-    + compilation stops at unit with error
-
-  Revision 1.33  1998/02/01 22:41:08  florian
-    * clean up
-    + system.assigned([class])
-    + system.assigned([class of xxxx])
-    * first fixes of as and is-operator
-
-  Revision 1.32  1998/01/30 17:31:23  pierre
-    * bug of cyclic symtablestack fixed
-
-  Revision 1.31  1998/01/29 12:13:21  michael
-  * fixed Typos for library making
-
-  Revision 1.30  1998/01/28 13:48:45  michael
-  + Initial implementation for making libs from within FPC. Not tested, as compiler does not run
-
-  Revision 1.29  1998/01/25 18:45:47  peter
-    + Search for as and ld at startup
-    + source_info works the same as target_info
-    + externlink allows only external linking
-
-  Revision 1.28  1998/01/23 21:14:59  carl
-    * RunError 105 (file not open) with -Agas switch fix
-
-  Revision 1.27  1998/01/23 17:55:11  michael
-  + Moved linking stage to it's own unit (link.pas)
-    Incorporated Pierres changes, but removed -E switch
-    switch for not linking is now -Cn instead of -E
-
-  Revision 1.26  1998/01/23 17:12:15  pierre
-    * added some improvements for as and ld :
-      - doserror and dosexitcode treated separately
-      - PATH searched if doserror=2
-    + start of long and ansi string (far from complete)
-      in conditionnal UseLongString and UseAnsiString
-    * options.pas cleaned (some variables shifted to globals)gl
-
-  Revision 1.25  1998/01/22 14:47:16  michael
-  + Reinstated linker options as -k option. How did they dissapear ?
-
-  Revision 1.24  1998/01/17 01:57:36  michael
-  + Start of shared library support. First working version.
-
-  Revision 1.23  1998/01/16 22:34:37  michael
-  * Changed 'conversation' to 'conversion'. Waayyy too much chatting going on
-    in this compiler :)
-
-  Revision 1.22  1998/01/14 12:52:04  michael
-  - Removed the 'Assembled' line and replaced 'Calling Linker/assembler...'
-    with 'Assembling/linking...'. Too much verbosity when V_info is on.
-
-  Revision 1.21  1998/01/13 16:15:56  pierre
-    *  bug in interdependent units handling
-       - primary unit was not in loaded_units list
-       - current_module^.symtable was assigned too early
-       - donescanner must not call error if the compilation
-       of the unit was done at a higher level.
-
-  Revision 1.20  1998/01/11 10:54:22  florian
-    + generic library support
-
-  Revision 1.19  1998/01/11 04:17:11  carl
-  + correct heap and memory variables for m68k targets
-
-  Revision 1.18  1998/01/08 23:56:39  florian
-    * parser unit divided into several smaller units
-
-  Revision 1.17  1998/01/08 17:10:12  florian
-    * the name of the initialization part of a unit was sometimes written
-      in lower case
-
-  Revision 1.16  1998/01/07 00:16:56  michael
-  Restored released version (plus fixes) as current
-
-  Revision 1.13  1997/12/14 22:43:21  florian
-    + command line switch -Xs for DOS (passes -s to the linker to strip symbols from
-      executable)
-    * some changes of Carl-Eric implemented
-
-  Revision 1.12  1997/12/12 13:28:31  florian
-  + version 0.99.0
-  * all WASM options changed into MASM
-  + -O2 for Pentium II optimizations
-
-  Revision 1.11  1997/12/10 23:07:21  florian
-  * bugs fixed: 12,38 (also m68k),39,40,41
-  + warning if a system unit is without -Us compiled
-  + warning if a method is virtual and private (was an error)
-  * some indentions changed
-  + factor does a better error recovering (omit some crashes)
-  + problem with @type(x) removed (crashed the compiler)
-
-  Revision 1.10  1997/12/09 13:50:36  carl
-  * bugfix of possible alignment problems with m68k
-  * bugfix of circular unit use -- could still give a stack overflow,
-    so changed to fatalerror instead.
-  * bugfix of nil procedural variables, fpc = @nil is illogical!
-    (if was reversed!)
-
-  Revision 1.9  1997/12/08 13:31:31  daniel
-  * File was in DOS format. Translated to Unix.
-
-  Revision 1.8  1997/12/08 10:01:08  pierre
-    * nil for a procvar const was not allowed (os2_targ.pas not compilable)
-    * bug in loadunit for units in implementation part already loaded
-      (crashed on dos_targ.pas, thanks to Daniel who permitted me
-      to find this bug out)
-
-  Revision 1.7  1997/12/04 17:47:50  carl
-   + renamed m68k units and refs to these units according to cpu rules.
-
-  Revision 1.6  1997/12/02 15:56:13  carl
-  * bugfix of postfixoperator with pd =nil
-  * bugfix of motorola instructions types for exit code.
-
-  Revision 1.5  1997/12/01 18:14:33  pierre
-      * fixes a bug in nasm output due to my previous changes
-
-  Revision 1.3  1997/11/28 18:14:40  pierre
-   working version with several bug fixes
-
-  Revision 1.2  1997/11/27 17:59:46  carl
-  * made it compile under BP (line too long errors)
-
-  Revision 1.1.1.1  1997/11/27 08:32:57  michael
-  FPC Compiler CVS start
-
-
-  Pre-CVS log:
-
-  CEC   Carl-Eric Codere
-  FK    Florian Klaempfl
-  PM    Pierre Muller
-  +     feature added
-  -     removed
-  *     bug fixed or changed
-
-
-
-  History (started with version 0.9.0):
-       5th november 1996:
-         * adapted to 0.9.0
-      25th november 1996:
-         * more stuff adapted
-       9th december 1996:
-         + support for different inline assemblers added (FK)
-      22th september:
-         + support for PACKED RECORD implemented (FK)
-      24th september:
-         + internal support of system.seg added (FK)
-         * system.ofs bug fixed (FK)
-         * problem with compiler switches solved (see also pass_1.pas) (FK)
-         * all aktswitch memory is now recoverd (see also scanner.pas) (FK)
-      24th september 1997:
-         * bug in ESI offset, pushed only if not nested, changed in cgi386.pas in v93 by (FK)
-           but forgotten here (PM)
-      25th september:
-         + parsing of open arrays implemented (FK)
-         + parsing of high and low implemented (FK)
-         + open array support also for proc vars added (FK)
-      1th october:
-         * in typed constants is now the conversion int -> real
-           automatically done (FK)
-      3rd october 1997:
-         + started conversion to motorola 68000 - ifdef m68k to find
-           changes (this makes the code look horrible, may later separate
-           in includes?) - look for all ifdef i386 and ifdef m68k to see
-           changes. (CEC)
-         - commented out regnames (was unused) (CEC)
-         + peepholeopt put in i386 define (not yet available for motorola
-            68000) (CEC)
-         + i386 defines around a_att, in a_o and around a_wasm, a_nasm (CEC).
-         + code for in_ord_x (PM)
-      4th october 1997:
-         + checking for double definitions of function/procedure
-           with same parameters in interface (PM)
-         + enums with jumps set the boolean has_jumps and
-           disable the succ and pred use (PM)
-       9th october 1997:
-         * Fixed problem with 80float on the 68000 output, caused a GPF (CEC).
-      13th october 1997:
-         + Added support for Motorola Standard assembler. (CEC)
-       15th october 1997:
-         + added code for static modifier for objects variables and methods
-           controlled by -St switch at command line (PM)
-      17th october 1997:
-        + Added support for Motorola inline assembler (CEC)
-        * Bugfix with .align 4,0x90, this is NOT allowed in TASM/MASM/WASM (CEC).
-        + procedure set_macro and setting of fpc_* macros (FK)
-      19th october 1997:
-        * Bugfix of RTS on 68000 target. PC Counter would become corrupt
-          with paramsize (CEC).
-      23th october 1997:
-        * Small bugfixes concerning SUBI #const,address_reg (CEC).
-      24th october 1997:
-        * array[boolean] works now (FK)
-      25th october 1997:
-        + CDECL and STDCALL (FK)
-        * ASSEMBLER isn't a keyword anymore (FK)
-       3rd november 1997:
-         + added symdif for sets (PM)
-       5th november 1997:
-         * changed all while token<>ATOKEN do consume(token);
-           by a procedure call consume_all_untill(ATOKEN)
-           to test for _EOF (PM)
-         * aktobjectname was not reset to '' at the end of objectcomponenten (PM)
-       14th november 1997:
-         * removed bug for procvar where the type was not allways set correctly (PM)
-         + integer const not in longint range converted to real constant (PM)
-       25th november 1997:
-         * removed bugs due to wrong current_module references in compile procedure (PM)
-
 }
 
 

+ 40 - 215
compiler/pmodules.pas

@@ -49,7 +49,8 @@ unit pmodules;
 {$endif}
        ;
 
-    function loadunit(const s : string;compile_system, in_uses : boolean) : pmodule;
+    procedure addlinkerfiles(hp:pmodule);
+    function  loadunit(const s : string;compile_system, in_uses : boolean) : pmodule;
     procedure proc_unit;
     procedure proc_program(islibrary : boolean);
 
@@ -60,6 +61,19 @@ unit pmodules;
 
     {$I innr.inc}
 
+    procedure addlinkerfiles(hp:pmodule);
+      begin
+        with hp^ do
+         begin
+           while not linkofiles.empty do
+            Linker.AddObject(linkofiles.Get);
+           while not linksharedlibs.empty do
+            Linker.AddSharedLibrary(linksharedlibs.Get);
+           while not linkstaticlibs.empty do
+            Linker.AddStaticLibrary(linkstaticlibs.Get);
+         end;
+      end;
+
     { all intern procedures for system unit }
 
     procedure insertinternsyms(p : psymtable);
@@ -116,7 +130,7 @@ unit pmodules;
          p^.insert(new(ptypesym,init('string',cstringdef)));
          p^.insert(new(ptypesym,init('longstring',clongstringdef)));
          p^.insert(new(ptypesym,init('ansistring',cansistringdef)));
-         p^.insert(new(ptypesym,init('widestring',cansistringdef)));
+         p^.insert(new(ptypesym,init('widestring',cwidestringdef)));
          p^.insert(new(ptypesym,init('word',u16bitdef)));
          p^.insert(new(ptypesym,init('boolean',booldef)));
          p^.insert(new(ptypesym,init('void_pointer',voidpointerdef)));
@@ -353,15 +367,13 @@ unit pmodules;
                 begin
                 { only reassemble ? }
                   if (hp^.do_assemble) then
-                   OnlyAsm(hp^.asmfilename^);
+                    OnlyAsm(hp^.asmfilename^);
                  { we should know there the PPU file else it's an error and
                    we can't load the unit }
                   if hp^.ppufile^.name^<>'' then
-                    begin
-                      if (hp^.flags and uf_in_library)=0 then
-                       Linker.AddObjectFile(hp^.objfilename^);
-                      load_ppu(hp,compile_system);
-                    end;
+                    load_ppu(hp,compile_system);
+                 { add the files for the linker }
+                  addlinkerfiles(hp);
                 end;
 
               { register the unit _once_ }
@@ -548,12 +560,14 @@ unit pmodules;
                Message(unit_w_switch_us_missed);
              dispose(s2);
              dispose(s1);
-	     
-	  { Add Object File }     
-             Linker.AddObjectFile(current_module^.objfilename^);
-             current_module^.linkofiles.insert(current_module^.objfilename^);
+
+          { Add Object File }
+             if smartlink then
+              current_module^.linkstaticlibs.insert(current_module^.arfilename^)
+             else
+              current_module^.linkofiles.insert(current_module^.objfilename^);
           end;
-	  
+
          consume(ID);
          consume(SEMICOLON);
          consume(_INTERFACE);
@@ -833,7 +847,7 @@ unit pmodules;
          aktprocsym:=new(Pprocsym,init('main'));
          aktprocsym^.definition:=new(Pprocdef,init);
          aktprocsym^.definition^.options:=aktprocsym^.definition^.options or poproginit;
-         aktprocsym^.definition^.setmangledname(target_info.Cprefix+'main');
+         aktprocsym^.definition^.setmangledname(target_os.Cprefix+'main');
          {The localst is a local symtable. Change it into the static
           symtable.}
          dispose(aktprocsym^.definition^.localst,done);
@@ -849,7 +863,7 @@ unit pmodules;
 
          {Load the units used by the program we compile.}
          if token=_USES then
-	   loadunits;
+           loadunits;
 
          {Insert the name of the main program into the symbol table.}
          if programname<>'' then
@@ -888,13 +902,15 @@ unit pmodules;
            target_WIN32 : names.insert('_main');
            target_LINUX : names.insert('main');
          end;
-
          compile_proc_body(names,true,false);
+         names.done;
 
          codegen_doneprocedure;
 
-         Linker.AddObjectFile(current_module^.objfilename^);
-         current_module^.linkofiles.insert(current_module^.objfilename^);
+         if smartlink then
+          current_module^.linkstaticlibs.insert(current_module^.arfilename^)
+         else
+          current_module^.linkofiles.insert(current_module^.objfilename^);
 
          if smartlink then
            begin
@@ -940,8 +956,6 @@ unit pmodules;
          datasegment^.concat(new(pai_const,init_32bit(heapsize)));
          datasize:=symtablestack^.datasize;
 
-         names.done;
-
          consume(POINT);
 
          symtablestack^.check_forwards;
@@ -951,7 +965,12 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.9  1998-05-01 16:38:45  florian
+  Revision 1.10  1998-05-04 17:54:28  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.9  1998/05/01 16:38:45  florian
     * handling of private and protected fixed
     + change_keywords_to_tp implemented to remove
       keywords which aren't supported by tp
@@ -988,198 +1007,4 @@ end.
 
   Revision 1.3  1998/04/03 09:51:00  daniel
   * Fixed heap allocation for OS/2.
-
-  Revision 1.2  1998/03/30 15:53:01  florian
-    * last changes before release:
-       - gdb fixed
-       - ratti386 warning removed (about unset function result)
-
-  Revision 1.1.1.1  1998/03/25 11:18:15  root
-  * Restored version
-
-  Revision 1.43  1998/03/20 23:31:34  florian
-    * bug0113 fixed
-    * problem with interdepened units fixed ("options.pas problem")
-    * two small extensions for future AMD 3D support
-
-  Revision 1.42  1998/03/11 22:22:52  florian
-    * Fixed circular unit uses, when the units are not in the current dir (from Peter)
-    * -i shows correct info, not <lf> anymore (from Peter)
-    * linking with shared libs works again (from Peter)
-
-  Revision 1.41  1998/03/10 17:19:29  peter
-    * fixed bug0108
-    * better linebreak scanning (concentrated in nextchar(), it supports
-      #10, #13, #10#13, #13#10
-
-  Revision 1.40  1998/03/10 16:27:42  pierre
-    * better line info in stabs debug
-    * symtabletype and lexlevel separated into two fields of tsymtable
-    + ifdef MAKELIB for direct library output, not complete
-    + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
-      working
-    + ifdef TESTFUNCRET for setting func result in underfunction, not
-      working
-
-  Revision 1.39  1998/03/10 01:17:24  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.38  1998/03/05 22:43:50  florian
-    * some win32 support stuff added
-
-  Revision 1.37  1998/03/04 01:35:08  peter
-    * messages for unit-handling and assembler/linker
-    * the compiler compiles without -dGDB, but doesn't work yet
-    + -vh for Hint
-
-  Revision 1.36  1998/03/03 23:18:45  florian
-    * ret $8 problem with unit init/main program fixed
-
-  Revision 1.35  1998/03/02 13:38:48  peter
-    + importlib object
-    * doesn't crash on a systemunit anymore
-    * updated makefile and depend
-
-  Revision 1.34  1998/03/02 01:49:04  peter
-    * renamed target_DOS to target_GO32V1
-    + new verbose system, merged old errors and verbose units into one new
-      verbose.pas, so errors.pas is obsolete
-
-  Revision 1.33  1998/03/01 22:46:20  florian
-    + some win95 linking stuff
-    * a couple of bugs fixed:
-      bug0055,bug0058,bug0059,bug0064,bug0072,bug0093,bug0095,bug0098
-
-  Revision 1.32  1998/02/28 09:30:58  florian
-    + writing of win32 import section added
-
-  Revision 1.31  1998/02/28 03:57:08  carl
-    + replaced target_info.short_name by target_info.target (a bit faster)
-
-  Revision 1.30  1998/02/27 09:25:58  daniel
-  * Changed symtable handling so no junk symtable is put on the symtablestack.
-
-  Revision 1.28  1998/02/24 14:20:54  peter
-    + tstringcontainer.empty
-    * ld -T option restored for linux
-    * libraries are placed before the objectfiles in a .PPU file
-    * removed 'uses link' from files.pas
-
-  Revision 1.27  1998/02/24 00:19:19  peter
-    * makefile works again (btw. linux does like any char after a \ )
-    * removed circular unit with assemble and files
-    * fixed a sigsegv in pexpr
-    * pmodule init unit/program is the almost the same, merged them
-
-  Revision 1.26  1998/02/22 23:55:18  peter
-    * small fix
-
-  Revision 1.25  1998/02/22 23:03:28  peter
-    * renamed msource->mainsource and name->unitname
-    * optimized filename handling, filename is not seperate anymore with
-      path+name+ext, this saves stackspace and a lot of fsplit()'s
-    * recompiling of some units in libraries fixed
-    * shared libraries are working again
-    + $LINKLIB <lib> to support automatic linking to libraries
-    + libraries are saved/read from the ppufile, also allows more libraries
-      per ppufile
-
-  Revision 1.24  1998/02/22 18:51:06  carl
-    * where the heck did the HEAP for m68k go??????? REINSTATED
-
-  Revision 1.23  1998/02/21 05:50:14  carl
-    * bugfix of crash with Us switch
-
-  Revision 1.22  1998/02/19 00:11:08  peter
-    * fixed -g to work again
-    * fixed some typos with the scriptobject
-
-  Revision 1.21  1998/02/17 21:20:57  peter
-    + Script unit
-    + __EXIT is called again to exit a program
-    - target_info.link/assembler calls
-    * linking works again for dos
-    * optimized a few filehandling functions
-    * fixed stabs generation for procedures
-
-  Revision 1.20  1998/02/16 12:51:38  michael
-  + Implemented linker object
-
-  Revision 1.19  1998/02/14 01:45:29  peter
-    * more fixes
-    - pmode target is removed
-    - search_as_ld is removed, this is done in the link.pas/assemble.pas
-    + findexe() to search for an executable (linker,assembler,binder)
-
-  Revision 1.18  1998/02/13 22:26:37  peter
-    * fixed a few SigSegv's
-    * INIT$$ was not written for linux!
-    * assembling and linking works again for linux and dos
-    + assembler object, only attasmi3 supported yet
-    * restore pp.pas with AddPath etc.
-
-  Revision 1.17  1998/02/13 10:35:27  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
-  Revision 1.16  1998/02/12 17:19:22  florian
-    * fixed to get remake3 work, but needs additional fixes (output, I don't like
-      also that aktswitches isn't a pointer)
-
-  Revision 1.15  1998/02/12 11:50:28  daniel
-  Yes! Finally! After three retries, my patch!
-
-  Changes:
-
-  Complete rewrite of psub.pas.
-  Added support for DLL's.
-  Compiler requires less memory.
-  Platform units for each platform.
-
-  Revision 1.14  1998/01/30 17:31:26  pierre
-    * bug of cyclic symtablestack fixed
-
-  Revision 1.13  1998/01/28 13:48:49  michael
-  + Initial implementation for making libs from within FPC. Not tested, as compiler does not run
-
-  Revision 1.12  1998/01/19 15:46:25  peter
-  * fixed INIT$$lowercase generation
-
-  Revision 1.11  1998/01/19 09:32:28  michael
-  * Shared Lib and GDB/RHIDE Bufixes from Peter Vreman.
-
-  Revision 1.10  1998/01/17 01:57:39  michael
-  + Start of shared library support. First working version.
-
-  Revision 1.9  1998/01/16 18:03:17  florian
-    * small bug fixes, some stuff of delphi styled constructores added
-
-  Revision 1.8  1998/01/13 23:11:15  florian
-    + class methods
-
-  Revision 1.7  1998/01/13 17:13:09  michael
-  * File time handling and file searching is now done in an OS-independent way,
-    using the new file treating functions in globals.pas.
-
-  Revision 1.6  1998/01/13 16:16:03  pierre
-    *  bug in interdependent units handling
-       - primary unit was not in loaded_units list
-       - current_module^.symtable was assigned too early
-       - donescanner must not call error if the compilation
-       of the unit was done at a higher level.
-
-  Revision 1.5  1998/01/12 13:03:32  florian
-    + parsing of class methods implemented
-
-  Revision 1.4  1998/01/11 10:54:24  florian
-    + generic library support
-
-  Revision 1.3  1998/01/11 04:17:36  carl
-  + floating point support for m68k
-
-  Revision 1.2  1998/01/09 09:10:01  michael
-  + Initial implementation, second try
-
 }

+ 9 - 170
compiler/pp.pas

@@ -351,16 +351,15 @@ begin
    {show some info}
    Message1(general_i_compilername,FixFileName(paramstr(0)));
    Message1(general_i_unitsearchpath,unitsearchpath);
-   Message1(general_d_sourceos,source_info.source_name);
-   Message1(general_i_targetos,target_info.target_name);
+   Message1(general_d_sourceos,source_os.name);
+   Message1(general_i_targetos,target_os.name);
    Message1(general_u_exepath,exepath);
 {$ifdef linux}
-   Message1(general_u_gcclibpath,Linker.gcclibrarypath);
+   Message1(general_u_gcclibpath,librarysearchpath);
 {$endif}
 
    start:=getrealtime;
    compile(inputdir+inputfile+inputextension,false);
-
    if errorcount=0 then
     begin
       start:=getrealtime-start;
@@ -380,7 +379,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.6  1998-04-29 13:40:23  peter
+  Revision 1.7  1998-05-04 17:54:28  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.6  1998/04/29 13:40:23  peter
     + heapblocks:=true
 
   Revision 1.5  1998/04/29 10:33:59  pierre
@@ -400,169 +404,4 @@ end.
       in MEM parsing for go32v2
       better external symbol creation
       support for rhgdb.exe (lowercase file names)
-
-  Revision 1.1.1.1  1998/03/25 11:18:14  root
-  * Restored version
-
-  Revision 1.40  1998/03/16 22:42:21  florian
-    * some fixes of Peter applied:
-      ofs problem, profiler support
-
-  Revision 1.39  1998/03/10 15:20:30  carl
-    * bugfix of spelling mistake
-     * make it compile under TP with overlays
-
-  Revision 1.38  1998/03/10 13:23:00  florian
-    * small win32 problems fixed
-
-  Revision 1.37  1998/03/10 01:17:24  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.36  1998/03/06 00:52:46  peter
-    * replaced all old messages from errore.msg, only ExtDebug and some
-      Comment() calls are left
-    * fixed options.pas
-
-  Revision 1.35  1998/03/05 02:44:16  peter
-    * options cleanup and use of .msg file
-
-  Revision 1.34  1998/03/04 17:33:52  michael
-  + Changed ifdef FPK to ifdef FPC
-
-  Revision 1.33  1998/03/02 23:08:42  florian
-    * the concatcopy bug removed (solves problems when compilg sysatari!)
-
-  Revision 1.32  1998/03/02 16:02:04  peter
-    * new style messages for pp.pas
-    * cleanup of pp.pas
-
-  Revision 1.31  1998/03/02 13:38:49  peter
-    + importlib object
-    * doesn't crash on a systemunit anymore
-    * updated makefile and depend
-
-  Revision 1.30  1998/03/02 01:49:05  peter
-    * renamed target_DOS to target_GO32V1
-    + new verbose system, merged old errors and verbose units into one new
-      verbose.pas, so errors.pas is obsolete
-
-  Revision 1.29  1998/02/25 14:31:28  jonas
-    * added $d- for TP compiling (disable strict var checking) and removed a duplicate $M statement
-
-  Revision 1.28  1998/02/22 23:03:29  peter
-    * renamed msource->mainsource and name->unitname
-    * optimized filename handling, filename is not seperate anymore with
-      path+name+ext, this saves stackspace and a lot of fsplit()'s
-    * recompiling of some units in libraries fixed
-    * shared libraries are working again
-    + $LINKLIB <lib> to support automatic linking to libraries
-    + libraries are saved/read from the ppufile, also allows more libraries
-      per ppufile
-
-  Revision 1.27  1998/02/16 14:19:15  florian
-  *** empty log message ***
-
-  Revision 1.26  1998/02/16 13:46:43  michael
-  + Further integration of linker object:
-    - all options pertaining to linking go directly to linker object
-    - removed redundant variables/procedures, especially in OS_TARG...
-
-  Revision 1.25  1998/02/16 12:51:40  michael
-  + Implemented linker object
-
-  Revision 1.24  1998/02/14 05:04:49  carl
-    + more overlay stuff for m68k target
-
-  Revision 1.23  1998/02/14 01:45:30  peter
-    * more fixes
-    - pmode target is removed
-    - search_as_ld is removed, this is done in the link.pas/assemble.pas
-    + findexe() to search for an executable (linker,assembler,binder)
-
-  Revision 1.22  1998/02/13 22:26:39  peter
-    * fixed a few SigSegv's
-    * INIT$$ was not written for linux!
-    * assembling and linking works again for linux and dos
-    + assembler object, only attasmi3 supported yet
-    * restore pp.pas with AddPath etc.
-
-  Revision 1.18  1998/02/03 22:13:34  florian
-    * clean up
-
-  Revision 1.17  1998/02/02 00:55:33  peter
-    * defdatei -> deffile and some german comments to english
-    * search() accepts : as seperater under linux
-    * search for ppc.cfg doesn't open a file (and let it open)
-    * reorganize the reading of parameters/file a bit
-    * all the PPC_ environments are now for all platforms
-
-  Revision 1.16  1998/01/27 10:48:19  florian
-    * dpmiexcp is now always used by a go32v2 compiler executable
-
-  Revision 1.15  1998/01/25 18:45:50  peter
-    + Search for as and ld at startup
-    + source_info works the same as target_info
-    + externlink allows only external linking
-
-  Revision 1.14  1998/01/23 10:46:42  florian
-    * small problems with FCL object model fixed, objpas?.inc is compilable
-
-  Revision 1.13  1998/01/18 21:34:29  florian
-  *** empty log message ***
-
-  Revision 1.12  1998/01/16 12:52:10  michael
-  + Path treatment and file searching should now be more or less in their
-    definite form:
-    - Using now modified AddPathToList everywhere.
-    - File Searching mechanism is uniform for all files.
-    - Include path is working now !!
-    All fixes by Peter Vreman. Tested with remake3 target.
-
-  Revision 1.11  1998/01/07 00:17:04  michael
-  Restored released version (plus fixes) as current
-
-  Revision 1.10  1997/12/12 13:28:39  florian
-  + version 0.99.0
-  * all WASM options changed into MASM
-  + -O2 for Pentium II optimizations
-
-  Revision 1.9  1997/12/09 13:57:21  carl
-  * bugfix when compiling using overlays
-
-  Revision 1.8  1997/12/05 14:38:39  carl
-  * equivalent to version 1.5 (otherwise would not compile)
-
-  Revision 1.5  1997/12/03 14:36:14  carl
-  * bugfix of my bug with $ifdef support_mxx
-
-  Revision 1.4  1997/12/03 13:41:37  carl
-   + checks that i386 is defined if with mmx_support switch.
-
-  Revision 1.3  1997/11/29 15:40:10  florian
-  + myexit is now executed
-
-  Revision 1.2  1997/11/28 18:14:43  pierre
-   working version with several bug fixes
-
-  Revision 1.1.1.1  1997/11/27 08:33:00  michael
-  FPC Compiler CVS start
-
-
-  Pre-CVS log:
-
-  FK     Florian Klaempfl
-  +      feature added
-  -      removed
-  *      bug fixed or changed
-
-  History (started at 19th september 1997):
-      19th september 1997:
-       + informations about ccompiler switches added (FK)
-       2nd october 1997:
-         *- removed ifndef dpmi for stream init, tmemorystream is used if
-          in dpmi everywhere else if use_big on. (CEC)
-       6th november 1997:
-         - crt unit to allow output redirection (FK)
 }

+ 7 - 6
compiler/scandir.inc

@@ -628,9 +628,6 @@ const
       begin
         skipspace;
         hs:=FixFileName(readstring);
-        if (not path_absolute(hs)) and (not assigned(current_module^.current_inputfile^.path)) then
-         path:=search(hs,current_module^.current_inputfile^.path^+';'+objectsearchpath,found);
-        Linker.AddObjectFile(path+hs);
         current_module^.linkofiles.insert(hs);
       end;
 
@@ -641,8 +638,7 @@ const
       begin
         skipspace;
         hs:=FixFileName(readstring);
-        Linker.AddLibraryFile(hs);
-        current_module^.linklibfiles.insert(hs);
+        current_module^.linkSharedLibs.insert(hs);
       end;
 
 
@@ -825,7 +821,12 @@ const
 
 {
   $Log$
-  Revision 1.5  1998-04-30 15:59:42  pierre
+  Revision 1.6  1998-05-04 17:54:28  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.5  1998/04/30 15:59:42  pierre
     * GDB works again better :
       correct type info in one pass
     + UseTokenInfo for better source position

+ 7 - 2
compiler/scanner.pas

@@ -191,7 +191,7 @@ unit scanner;
 
      uses
        dos,verbose,pbase,
-       symtable,switches,link;
+       symtable,switches;
 
      var
     { this is usefull to get the write filename
@@ -1461,7 +1461,12 @@ unit scanner;
 end.
 {
   $Log$
-  Revision 1.15  1998-05-01 16:38:46  florian
+  Revision 1.16  1998-05-04 17:54:28  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.15  1998/05/01 16:38:46  florian
     * handling of private and protected fixed
     + change_keywords_to_tp implemented to remove
       keywords which aren't supported by tp

+ 24 - 40
compiler/script.pas

@@ -35,7 +35,7 @@ type
     destructor Done;
     procedure AddStart(const s:string);
     procedure Add(const s:string);
-    Function Empty:boolean;
+    Function  Empty:boolean;
     procedure WriteToDisk;virtual;
   end;
 
@@ -68,7 +68,7 @@ uses
 
 constructor TScript.Init(const s:string);
 begin
-  fn:=FixFileName(s)+source_info.scriptext;
+  fn:=FixFileName(s)+source_os.scriptext;
   data.Init;
 end;
 
@@ -117,44 +117,50 @@ end;
 ****************************************************************************}
 
 Constructor TAsmScript.Init (Const ScriptName : String);
-
 begin
   Inherited Init(ScriptName);
 end;
 
-Procedure TAsmScript.AddAsmCommand (Const Command, Options,FileName : String);
 
+Procedure TAsmScript.AddAsmCommand (Const Command, Options,FileName : String);
 begin
   {$ifdef linux}
-  Add('echo Assembling '+FileName);
+  if FileName<>'' then
+   Add('echo Assembling '+FileName);
   Add (Command+' '+Options);
   Add('if [ $? != 0 ]; then DoExitAsm '+FileName+'; fi');
   {$else}
-  Add('SET THEFILE='+FileName);
-  Add('echo Assembling %THEFILE%');
+  if FileName<>'' then
+   begin
+     Add('SET THEFILE='+FileName);
+     Add('echo Assembling %THEFILE%');
+   end;
   Add(command+' '+Options);
   Add('if errorlevel 1 goto asmend');
   {$endif}
 end;
 
-Procedure TasmScript.AddLinkCommand (Const Command, Options, FileName : String);
 
+Procedure TasmScript.AddLinkCommand (Const Command, Options, FileName : String);
 begin
   {$ifdef linux}
-  Add('echo Linking '+FileName);
+  if FileName<>'' then
+   Add('echo Linking '+FileName);
   Add (Command+' '+Options);
   Add('if [ $? != 0 ]; then DoExitLink '+FileName+'; fi');
   {$else}
-  Add('SET THEFILE='+FileName);
-  Add('echo Linking %THEFILE%');
+  if FileName<>'' then
+   begin
+     Add('SET THEFILE='+FileName);
+     Add('echo Linking %THEFILE%');
+   end;
   Add (Command+' '+Options);
   Add('if errorlevel 1 goto linkend');
   {$endif}
 end;
 
 
- Procedure TAsmScript.AddDeleteCommand (Const FileName : String);
-
+Procedure TAsmScript.AddDeleteCommand (Const FileName : String);
 begin
  {$ifdef linux}
  Add('rm '+FileName);
@@ -165,7 +171,6 @@ end;
 
 
 Procedure TAsmScript.WriteToDisk;
-
 Begin
 {$ifdef linux}
   AddStart('{ echo "An error occurred while linking $1"; exit 1; }');
@@ -190,30 +195,9 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  1998-03-25 11:18:13  root
-  Initial revision
-
-  Revision 1.6  1998/03/10 01:17:28  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.5  1998/02/23 12:53:46  pierre
-    + added some info when running ppas.bat
-      * updated makefile
-
-  Revision 1.4  1998/02/19 00:11:08  peter
-    * fixed -g to work again
-    * fixed some typos with the scriptobject
-
-  Revision 1.3  1998/02/18 14:18:30  michael
-  + added log at end of file (retroactively)
-
-  revision 1.2
-  date: 1998/02/18 13:43:15;  author: michael;  state: Exp;  lines: +75 -20
-  + Implemented an OS independent AsmRes object.
-  ----------------------------
-  revision 1.1
-  date: 1998/02/17 21:44:04;  author: peter;  state: Exp;
-    + Initial implementation
+  Revision 1.2  1998-05-04 17:54:29  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
 }

+ 406 - 411
compiler/systems.pas

@@ -26,320 +26,464 @@ unit systems;
   interface
 
     type
-       { target operanting system }
-       ttarget = (target_GO32V1,target_OS2,target_LINUX,
-                  target_WIN32,target_GO32V2,
-                  target_Amiga,target_Atari,target_Mac68k);
+       ttarget = (target_GO32V1,target_GO32V2,target_LINUX,target_OS2,
+                  target_WIN32,target_Amiga,target_Atari,target_Mac68k);
+
+       tos = (os_GO32V1, os_GO32V2, os_Linux, os_OS2,
+              os_WIN32, os_Amiga, os_Atari, os_Mac68k);
+
+       tasm = (as_as
+       {$ifdef i386}
+              ,as_nasmcoff, as_nasmelf, as_nasmobj
+       {$endif}
+       {$ifdef m68k}
+              ,as_as68k
+       {$endif}
+       );
+
+       tlink = (link_ld
+       {$ifdef i386}
+              ,link_ldgo32v1, link_ldgo32v2, link_ldw, link_ldos2);
+       {$endif i386}
 
        tendian = (endian_little,en_big_endian);
 
+       tosinfo = record
+          name      : string[30];
+          sharedlibext,
+          staticlibext,
+          sourceext,
+          pasext,
+          exeext,
+          scriptext : string[4];
+          Cprefix   : string[2];
+          newline   : string[2];
+          endian    : tendian;
+          use_function_relative_addresses : boolean;
+       end;
+
+       tasminfo = record
+          id          : tasm;
+          idtxt       : string[8];
+          asmbin      : string[8];
+          asmcmd      : string[50];
+          labelprefix : string[2];
+          comment     : string[2];
+       end;
+
+       tlinkinfo = record
+          linkbin   : string[8];
+          linkcmd   : string[40];
+          stripopt  : string[2];
+          groupstart,
+          groupend,
+          inputstart,
+          inputend  : string[8];
+          libprefix : string[2];
+       end;
 
        ttargetinfo = record
-          target : ttarget;
-          target_name : string[30];
-          short_name : string[8];
-          unit_env : string[20];
+          target      : ttarget;
+          short_name  : string[8];
+          unit_env    : string[12];
           system_unit : string[8];
-          exeext,
-          objext,
-          dllext,
-          arext,
+          smartext,
           unitext,
-          libext,
+          unitlibext,
           asmext,
-          sourceext,
-          pasext  : string[4];
-          newline : string[3];
-          labelprefix : string[2];
-          Cprefix : string[2];
-          use_function_relative_addresses : boolean;
-          endian : tendian;
-       end;
-
-       tsourceinfo = record
-          source:ttarget;
-          source_name:string[30];
-          exeext,
-          scriptext : string[4];
-          endian : tendian;
+          objext      : string[4];
+          os          : tos;
+          link        : tlink;
+          assem       : tasm;
        end;
 
     var
-       source_info : tsourceinfo;
        target_info : ttargetinfo;
+       target_os   : tosinfo;
+       target_asm  : tasminfo;
+       target_link : tlinkinfo;
+       source_os   : tosinfo;
 
     function set_string_target(const s : string) : boolean;
 
   implementation
 
     const
-       target_infos : array[ttarget] of ttargetinfo = (
+       os_infos : array[tos] of tosinfo = (
           (
-            target : target_GO32V1;
-            target_name : 'GO32 V1 DOS extender';
-            short_name : 'GO32V1';
-            unit_env : 'GO32V1UNITS';
-            system_unit : 'SYSTEM';
-            exeext : '';
-            objext : '.O1';
-            dllext : '.DLL';
-            arext : '.A';
-            unitext : '.PP1';
-            libext : '.PPL';
-            asmext : '.S1';
-            sourceext : '.PP';
-            pasext : '.PAS';
-            newline : #13#10;
-            labelprefix : '.L';
-            Cprefix : '_';
-            use_function_relative_addresses : true;
-            endian : endian_little
+            name         : 'GO32 V1 DOS extender';
+            sharedlibext : '.DLL';
+            staticlibext : '.A';
+            sourceext    : '.PP';
+            pasext       : '.PAS';
+            exeext       : '.EXE';
+            scriptext    : '.BAT';
+            Cprefix      : '_';
+            newline      : #13#10;
+            endian       : endian_little;
+            use_function_relative_addresses : true
           ),
           (
-            target : target_OS2;
-            target_name : 'OS/2 (32 bit)';
-            short_name : 'OS2';
-            unit_env : 'OS2UNITS';
-            system_unit : 'SYSOS2';
-            exeext : '';
-            objext : '.oo2';
-            dllext : '.ao2';
-            arext : '.a';
-            unitext : '.ppo';
-            libext : '.ppl';
-            asmext : '.so2';
-            sourceext : '.pas';
-            pasext : '.pp';
-            newline : #13#10;
-            labelprefix : 'L';
-            Cprefix : '_';
-            use_function_relative_addresses : false;
-            endian : endian_little
+            name         : 'GO32 V2 DOS extender';
+            sharedlibext : '.DLL';
+            staticlibext : '.A';
+            sourceext    : '.PP';
+            pasext       : '.PAS';
+            exeext       : '.EXE';
+            scriptext    : '.BAT';
+            Cprefix      : '_';
+            newline      : #13#10;
+            endian       : endian_little;
+            use_function_relative_addresses : true
           ),
           (
-            target : target_LINUX;
-            target_name : 'Linux';
-            short_name : 'LINUX';
-            unit_env : 'LINUXUNITS';
-            system_unit : 'syslinux';
-            exeext : '';
-            objext : '.o';
-            dllext : '.so';
-            arext : '.a';
-            unitext : '.ppu';
-            libext : '.ppl';
-            asmext : '.s';
-            sourceext : '.pp';
-            pasext : '.pas';
-            newline : #10;
-            labelprefix : '.L';
-            Cprefix : '';
-            use_function_relative_addresses : true;
-            endian : endian_little
+            name         : 'Linux';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            scriptext    : '.sh';
+            Cprefix      : '';
+            newline      : #10;
+            endian       : endian_little;
+            use_function_relative_addresses : true
           ),
           (
-            target : target_WIN32;
-            target_name : 'Win32';
-            short_name : 'WIN32';
-            unit_env : 'WIN32UNITS';
-            system_unit : 'SYSWIN32';
-            exeext : '.exe';
-            objext : '.o';
-            dllext : '.dll';
-            arext : '.a';
-            unitext : '.ppw';
-            libext : '.ppl';
-            asmext : '.s';
-            sourceext : '.pp';
-            pasext : '.pas';
-            newline : #13#10;
-            labelprefix : '.L';
-            Cprefix : '_'; {???}
-            use_function_relative_addresses : true; {????}
-            endian : endian_little
+            name         : 'OS/2 (32bit)';
+            sharedlibext : '.ao2';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.exe';
+            scriptext    : '.cmd';
+            Cprefix      : '_';
+            newline      : #13#10;
+            endian       : endian_little;
+            use_function_relative_addresses : false
           ),
           (
-            target : target_GO32V2;
-            target_name : 'GO32 V2.0 DOS extender';
-            short_name : 'GO32V2';
-            unit_env : 'GO32V2UNITS';
-            system_unit : 'SYSTEM';
-            exeext : '.EXE';
-{$ifndef UseAnsiString}
-            objext : '.O';
-            dllext : '.DLL';
-            arext : '.A';
-            unitext : '.PPU';
-            libext : '.PPL';
-            asmext : '.S';
-{$else UseAnsiString}
-   { just for tests }
-            objext : '.OA';
-            dllext : '.DLL';
-            arext : '.AA';
-            unitext : '.PAU';
-            libext : '.PPL';
-            asmext : '.SA';
-{$endif UseAnsiString}
-            sourceext : '.PP';
-            pasext : '.PAS';
-            newline : #13#10;
-            labelprefix : '.L';
-            Cprefix : '_';
-            use_function_relative_addresses : true;
-            endian : endian_little
+            name         : 'Win32';
+            sharedlibext : '.dll';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.exe';
+            scriptext    : '.bat';
+            Cprefix      : '_';
+            newline      : #13#10;
+            endian       : endian_little;
+            use_function_relative_addresses : true
           ),
           (
-            target : target_Amiga;
-            target_name : 'Commodore Amiga';
-            short_name : 'AMIGA';
-            unit_env : '';
-            system_unit : 'sysamiga';  { case sensitive }
-            exeext : '';
-            objext : '.o';
-            dllext : '.library';
-            arext : '.a';
-            unitext : '.ppa';
-            libext : '.ppl';
-            asmext : '.asm';
-            sourceext : '.pp';
-            pasext : '.pas';
-            newline : #10;  { ??? }
-            labelprefix : '.L';
-            Cprefix : '';
-            use_function_relative_addresses : true;
-            endian : endian_little
+            name         : 'Commodore Amiga';
+            sharedlibext : '.library';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            scriptext    : '';
+            Cprefix      : '';
+            newline      : #10;
+            endian       : en_big_endian;
+            use_function_relative_addresses : false
           ),
           (
-            target : target_Atari;
-            target_name : 'Atari ST/STE';
-            short_name : 'ATARI';
-            unit_env : '';
-            system_unit : 'SYSATARI';
-            exeext : '.ttp';
-            objext : '.o';
-            dllext : '.dll';
-            arext : '.a';
-            unitext : '.PPT';
-            libext : '.PPL';
-            asmext : '.s';
-            sourceext : '.pp';
-            pasext : '.pas';
-            newline : #13#10;
-            labelprefix : '.L';
-            Cprefix : '';
-            use_function_relative_addresses : true;
-            endian : endian_little
+            name         : 'Atari ST/STE';
+            sharedlibext : '.dll';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.tpp';
+            scriptext    : '';
+            Cprefix      : '';
+            newline      : #10;
+            endian       : en_big_endian;
+            use_function_relative_addresses : false
           ),
           (
-            target : target_Mac68k;
-            target_name : 'Macintosh m68k';
-            short_name : 'MAC OS';
-            unit_env : '';
-            system_unit : 'sysmac';    { case sensitive }
-            exeext : '';
-            objext : '.o';
-            dllext : '.dll';
-            arext : '.a';
-            unitext : '.ppm';
-            libext : '.ppl';
-            asmext : '.asm';
-            sourceext : '.pp';
-            pasext : '.pas';
-            newline : #13;   { ??? }
-            labelprefix : '__L';{ only ascii A..Z,a..z or _ allowed as first }
-            Cprefix : '';
-            use_function_relative_addresses : true;
-            endian : endian_little
+            name         : 'Macintosh m68k';
+            sharedlibext : '.dll';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.tpp';
+            scriptext    : '';
+            Cprefix      : '';
+            newline      : #10;
+            endian       : en_big_endian;
+            use_function_relative_addresses : false
           )
-       );
+          );
+
+       as_infos : array[tasm] of tasminfo = (
+          (
+            id     : as_as;
+            idtxt  : 'O';
+            asmbin : 'as';
+            asmcmd : '-D -o $OBJ $ASM';
+            labelprefix : '.L';
+            comment : '# '
+          )
+{$ifdef i386}
+          ,(
+            id     : as_nasmcoff;
+{$ifdef linux}
+            idtxt  : 'NASM';
+{$else}
+            idtxt  : 'NASMCOFF';
+{$endif}
+            asmbin : 'nasm';
+            asmcmd : '-f coff -o $OBJ $ASM';
+            labelprefix : 'L';
+            comment : '; '
+          )
+          ,(
+            id     : as_nasmelf;
+{$ifdef linux}
+            idtxt  : 'NASM';
+{$else}
+            idtxt  : 'NASMELF';
+{$endif}
+            asmbin : 'nasm';
+            asmcmd : '-f elf -o $OBJ $ASM';
+            labelprefix : 'L';
+            comment : '; '
+          )
+          ,(
+            id     : as_nasmobj;
+            idtxt  : 'OBJ';
+            asmbin : 'nasm';
+            asmcmd : '-f obj -o $OBJ $ASM';
+            labelprefix : 'L';
+            comment : '; '
+          )
+{$endif}
+{$ifdef m68k}
+          ,(
+            id     : as_as68k;
+            idtxt  : 'O';
+            asmbin : 'as68k'; { Gas for the Amiga}
+            asmcmd : '-D --register-prefix-optional -o $OBJ $ASM';
+            labelprefix : '__L';
+            comment : '| '
+          )
+{$endif}
+          );
 
-       source_infos : array[ttarget] of tsourceinfo = (
+       link_infos : array[tlink] of tlinkinfo = (
           (
-            source : target_GO32V1;
-            source_name : 'GO32 V1 DOS extender';
-            exeext : '.EXE';
-            scriptext : '.BAT';
-            endian : endian_little
+            linkbin : 'ld';
+            linkcmd : '$OPT -o $EXE $RES';
+            stripopt   : '-s';
+            groupstart : 'GROUP(';
+            groupend   : ')';
+            inputstart : 'INPUT(';
+            inputend   : ')';
+            libprefix  : '-l'
+          )
+{$ifdef i386}
+
+
+          ,(
+            linkbin : 'ld';
+            linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
+            stripopt   : '-s';
+            groupstart : '-(';
+            groupend   : ')-';
+            inputstart : 'INPUT(';
+            inputend   : ')';
+            libprefix  : '-l'
+          )
+          ,(
+            linkbin : 'ld';
+            linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
+            stripopt   : '-s';
+            groupstart : '-(';
+            groupend   : ')-';
+            inputstart : 'INPUT(';
+            inputend   : ')';
+            libprefix  : '-l'
+          )
+          ,(
+            linkbin : 'ldw';
+            linkcmd : '$OPT -o $EXE $RES';
+            stripopt   : '-s';
+            groupstart : 'GROUP(';
+            groupend   : ')';
+            inputstart : 'INPUT(';
+            inputend   : ')';
+            libprefix  : '-l'
+          )
+          ,(
+            linkbin : 'ld';
+            linkcmd : '-o $EXE @$RES';
+            stripopt   : '-s';
+            groupstart : '-(';
+            groupend   : ')-';
+            inputstart : '';
+            inputend   : '';
+            libprefix  : ''
+          )
+{$endif i386}
+
+
+          );
+
+       target_infos : array[ttarget] of ttargetinfo = (
+          (
+            target      : target_GO32V1;
+            short_name  : 'GO32V1';
+            unit_env    : 'GO32V1UNITS';
+            system_unit : 'SYSTEM';
+            smartext    : '.SL';
+            unitext     : '.PP1';
+            unitlibext  : '.PPL';
+            asmext      : '.S1';
+            objext      : '.O1';
+            os          : os_GO32V1;
+            link        : link_ldgo32v1;
+            assem       : as_as
           ),
           (
-            source : target_OS2;
-            source_name : 'OS/2 (32 bit)';
-            exeext : '.EXE';
-            scriptext : '.CMD';
-            endian : endian_little
+            target      : target_GO32V2;
+            short_name  : 'GO32V2';
+            unit_env    : 'GO32V2UNITS';
+            system_unit : 'SYSTEM';
+{$ifndef UseAnsiString}
+            smartext    : '.SL';
+            unitext     : '.PPU';
+            unitlibext  : '.PPL';
+            asmext      : '.S';
+            objext      : '.O';
+{$else UseAnsiString}
+            smartext    : '.SL';
+            unitext     : '.PAU';
+            unitlibext  : '.PPL';
+            asmext      : '.SA';
+            objext      : '.OA';
+{$endif UseAnsiString}
+            os          : os_GO32V2;
+            link        : link_ldgo32v2;
+            assem       : as_as
           ),
           (
-            source : target_LINUX;
-            source_name : 'Linux';
-            exeext : '';
-            scriptext : '.sh';
-            endian : endian_little
+            target      : target_LINUX;
+            short_name  : 'LINUX';
+            unit_env    : 'LINUXUNITS';
+            system_unit : 'syslinux';
+            smartext    : '.sl';
+            unitext     : '.ppu';
+            unitlibext  : '.ppl';
+            asmext      : '.s';
+            objext      : '.o';
+            os          : os_Linux;
+            link        : link_ld;
+            assem       : as_as
           ),
           (
-            source : target_WIN32;
-            source_name : 'Win32';
-            exeext : '.EXE';
-            scriptext : '.BAT';
-            endian : endian_little
+            target      : target_OS2;
+            short_name  : 'OS2';
+            unit_env    : 'OS2UNITS';
+            system_unit : 'SYSOS2';
+            smartext    : '.sl';
+            unitext     : '.ppo';
+            unitlibext  : '.ppl';
+            asmext      : '.so2';
+            objext      : '.oo2';
+            os          : os_OS2;
+            link        : link_ldos2;
+            assem       : as_as
           ),
           (
-            source : target_GO32V2;
-            source_name : 'GO32 V2.0 DOS extender';
-            exeext : '.EXE';
-            scriptext : '.BAT';
-            endian : endian_little
+            target      : target_WIN32;
+            short_name  : 'WIN32';
+            unit_env    : 'WIN32UNITS';
+            system_unit : 'SYSWIN32';
+            smartext    : '.sl';
+            unitext     : '.ppw';
+            unitlibext  : '.ppl';
+            asmext      : '.s';
+            objext      : '.o';
+            os          : os_Win32;
+            link        : link_ldw;
+            assem       : as_as
           ),
           (
-            source : target_Amiga;
-            source_name : 'Commodore Amiga';
-            exeext : '';
-            scriptext : '';
-            endian : en_big_endian
+            target      : target_Amiga;
+            short_name  : 'AMIGA';
+            unit_env    : '';
+            system_unit : 'sysamiga';
+            smartext    : '.sl';
+            unitext     : '.ppa';
+            unitlibext  : '.ppl';
+            asmext      : '.asm';
+            objext      : '.o';
+            os          : os_Amiga;
+            link        : link_ld;
+            assem       : as_as
           ),
           (
-            source : target_Atari;
-            source_name : 'Atari ST/STE';
-            exeext : '.ttp';
-            scriptext : '';
-            endian : en_big_endian
+            target      : target_Atari;
+            short_name  : 'ATARI';
+            unit_env    : '';
+            system_unit : 'SYSATARI';
+            smartext    : '.sl';
+            unitext     : '.ppt';
+            unitlibext  : '.ppl';
+            asmext      : '.s';
+            objext      : '.o';
+            os          : os_Atari;
+            link        : link_ld;
+            assem       : as_as
           ),
           (
-            source : target_Mac68k;
-            source_name : 'Macintosh m68k';
-            exeext : '';
-            scriptext : '';
-            endian : en_big_endian
+            target      : target_Mac68k;
+            short_name  : 'MACOS';
+            unit_env    : '';
+            system_unit : 'sysmac';
+            smartext    : '.sl';
+            unitext     : '.ppt';
+            unitlibext  : '.ppl';
+            asmext      : '.s';
+            objext      : '.o';
+            os          : os_Mac68k;
+            link        : link_ld;
+            assem       : as_as
           )
-       );
+          );
 
-    procedure set_target(t : ttarget);
 
-      begin
-         target_info:=target_infos[t];
-      end;
+procedure set_target(t : ttarget);
+begin
+  target_info:=target_infos[t];
+  target_os:=os_infos[target_info.os];
+  target_asm:=as_infos[target_info.assem];
+  target_link:=link_infos[target_info.link];
+end;
 
-    function set_string_target(const s : string) : boolean;
 
-      var
-         t : ttarget;
 
-      begin
-         set_string_target:=false;
-         for t:=target_GO32V1 to target_mac68k do
-           if target_infos[t].short_name=s then
-             begin
-                set_string_target:=true;
-                set_target(t);
-             end;
-      end;
+function set_string_target(const s : string) : boolean;
+var
+  t : ttarget;
+begin
+  set_string_target:=false;
+  for t:=target_GO32V1 to target_mac68k do
+   if target_infos[t].short_name=s then
+    begin
+      set_string_target:=true;
+      set_target(t);
+    end;
+end;
+
 
-    procedure default_os(t:ttarget);
+procedure default_os(t:ttarget);
+begin
+  set_target(t);
+  source_os:=os_infos[target_info.os];
+end;
 
-      begin
-         set_target(t);
-         source_info:=source_infos[t];
-      end;
 
 begin
 {$ifdef tp}
@@ -376,7 +520,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.6  1998-05-01 07:43:57  florian
+  Revision 1.7  1998-05-04 17:54:29  peter
+    + smartlinking works (only case jumptable left todo)
+    * redesign of systems.pas to support assemblers and linkers
+    + Unitname is now also in the PPU-file, increased version to 14
+
+  Revision 1.6  1998/05/01 07:43:57  florian
     + basics for rtti implemented
     + switch $m (generate rtti for published sections)
 
@@ -394,158 +543,4 @@ end.
 
   Revision 1.3  1998/04/16 10:50:45  daniel
   * Fixed some things that were broken for OS/2.
-
-  Revision 1.2  1998/03/30 15:53:01  florian
-    * last changes before release:
-       - gdb fixed
-       - ratti386 warning removed (about unset function result)
-
-  Revision 1.1.1.1  1998/03/25 11:18:15  root
-  * Restored version
-
-  Revision 1.33  1998/03/10 23:48:37  florian
-    * a couple of bug fixes to get the compiler with -OGaxz compiler, sadly
-      enough, it doesn't run
-
-  Revision 1.32  1998/03/10 16:27:46  pierre
-    * better line info in stabs debug
-    * symtabletype and lexlevel separated into two fields of tsymtable
-    + ifdef MAKELIB for direct library output, not complete
-    + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
-      working
-    + ifdef TESTFUNCRET for setting func result in underfunction, not
-      working
-
-  Revision 1.31  1998/03/10 01:17:29  peter
-    * all files have the same header
-    * messages are fully implemented, EXTDEBUG uses Comment()
-    + AG... files for the Assembler generation
-
-  Revision 1.30  1998/03/05 22:43:53  florian
-    * some win32 support stuff added
-
-  Revision 1.29  1998/03/02 22:04:36  carl
-    + Added mac line break
-
-  Revision 1.28  1998/03/02 13:38:51  peter
-    + importlib object
-    * doesn't crash on a systemunit anymore
-    * updated makefile and depend
-
-  Revision 1.25  1998/02/28 00:20:34  florian
-    * more changes to get import libs for Win32 working
-
-  Revision 1.24  1998/02/27 22:28:01  florian
-    + win_targ unit
-    + support of sections
-    + new asmlists: sections, exports and resource
-
-  Revision 1.23  1998/02/27 21:24:20  florian
-    * dll support changed (dll name can be also a string contants)
-
-  Revision 1.22  1998/02/23 02:55:08  carl
-    + added correct extension to AMIGA libext
-
-  Revision 1.21  1998/02/22 23:03:39  peter
-    * renamed msource->mainsource and name->unitname
-    * optimized filename handling, filename is not seperate anymore with
-      path+name+ext, this saves stackspace and a lot of fsplit()'s
-    * recompiling of some units in libraries fixed
-    * shared libraries are working again
-    + $LINKLIB <lib> to support automatic linking to libraries
-    + libraries are saved/read from the ppufile, also allows more libraries
-      per ppufile
-
-  Revision 1.20  1998/02/18 14:14:44  michael
-  * removed entries for dos_targ and lin_targ
-
-  Revision 1.19  1998/02/17 21:21:05  peter
-    + Script unit
-    + __EXIT is called again to exit a program
-    - target_info.link/assembler calls
-    * linking works again for dos
-    * optimized a few filehandling functions
-    * fixed stabs generation for procedures
-
-  Revision 1.18  1998/02/14 01:45:35  peter
-    * more fixes
-    - pmode target is removed
-    - search_as_ld is removed, this is done in the link.pas/assemble.pas
-    + findexe() to search for an executable (linker,assembler,binder)
-
-  Revision 1.17  1998/02/13 22:26:45  peter
-    * fixed a few SigSegv's
-    * INIT$$ was not written for linux!
-    * assembling and linking works again for linux and dos
-    + assembler object, only attasmi3 supported yet
-    * restore pp.pas with AddPath etc.
-
-  Revision 1.16  1998/02/13 10:35:50  daniel
-  * Made Motorola version compilable.
-  * Fixed optimizer
-
-  Revision 1.15  1998/02/12 17:19:32  florian
-    * fixed to get remake3 work, but needs additional fixes (output, I don't like
-      also that aktswitches isn't a pointer)
-
-  Revision 1.14  1998/02/12 11:50:50  daniel
-  Yes! Finally! After three retries, my patch!
-
-  Changes:
-
-  Complete rewrite of psub.pas.
-  Added support for DLL's.
-  Compiler requires less memory.
-  Platform units for each platform.
-
-  Revision 1.11  1998/01/26 16:42:01  daniel
-  * Reversed source_ext and pas_ext for OS/2 target. The .pas extension is
-  recognized by the Workplace Shell of OS/2, the .pp is not.
-
-  Revision 1.10  1998/01/26 13:35:33  florian
-    * adapted to work with TP
-
-  Revision 1.9  1998/01/25 18:45:50  peter
-    + Search for as and ld at startup
-    + source_info works the same as target_info
-    + externlink allows only external linking
-
-  Revision 1.8  1998/01/22 08:57:55  peter
-    + added target_info.pasext and target_info.libext
-
-  Revision 1.7  1998/01/09 19:44:09  carl
-    * labels for mac68k target now use the MPW correct syntax
-
-  Revision 1.6  1997/12/12 13:28:42  florian
-  + version 0.99.0
-  * all WASM options changed into MASM
-  + -O2 for Pentium II optimizations
-
-  Revision 1.5  1997/12/09 14:12:21  carl
-  + added planned m68k systems, and fixed some problems in amiga info.
-
-  Revision 1.4  1997/12/08 11:53:49  pierre
-      reverted to old version of systems.pas,
-      Daniel's version is not compilable due to the bug (corrected) of
-      mil value for a procvar const !!
-
-  Revision 1.1.1.1  1997/11/27 08:33:02  michael
-  FPC Compiler CVS start
-
-  Pre-CVS log:
-
-    CEC    Carl-Eric Codere
-    FK     Florian Klaempfl
-    +      feature added
-    -      removed
-    *      bug fixed or changed
-
-  History:
-      15th october 1996:
-         + ttargetinfo.newline added (FK)
-      19th september 1997:
-         * the suffix of GO32V1 units is now PP1 (FK)
-       8th october 1997:
-         + target amiga added for tests, unit should divided
-           into sysi386 and sysm68k (FK)
 }