Browse Source

* some dll support for win32
* fixed assembler writing for PalmOS

florian 27 năm trước cách đây
mục cha
commit
7e40231ad7

+ 33 - 12
compiler/ag68kgas.pas

@@ -96,7 +96,8 @@ unit ag68kgas;
 
     function getreferencestring(const ref : treference) : string;
       var
-         s : string;
+         s,basestr,indexstr : string;
+
       begin
          s:='';
          if ref.isintvalue then
@@ -104,6 +105,16 @@ unit ag68kgas;
          else
            with ref do
              begin
+                if target_info.target=target_m68k_PalmOS then
+                  begin
+                     basestr:=gasPalmOS_reg2str[base];
+                     indexstr:=gasPalmOS_reg2str[index];
+                  end
+                else
+                  begin
+                     basestr:=gas_reg2str[base];
+                     indexstr:=gas_reg2str[index];
+                  end;
                 if assigned(symbol) then
                   s:=s+symbol^;
 
@@ -116,34 +127,34 @@ unit ag68kgas;
                if (index<>R_NO) and (base=R_NO) and (direction=dir_none) then
                 begin
                   if (scalefactor = 1) or (scalefactor = 0) then
-                    s:=s+'(,'+gas_reg2str[index]+'.l)'
+                    s:=s+'(,'+indexstr+'.l)'
                   else
-                    s:=s+'(,'+gas_reg2str[index]+'.l*'+tostr(scalefactor)+')'
+                    s:=s+'(,'+indexstr+'.l*'+tostr(scalefactor)+')'
                 end
                 else if (index=R_NO) and (base<>R_NO) and (direction=dir_inc) then
                 begin
                   if (scalefactor = 1) or (scalefactor = 0) then
-                      s:=s+'('+gas_reg2str[base]+')+'
+                      s:=s+'('+basestr+')+'
                   else
                    InternalError(10002);
                 end
                 else if (index=R_NO) and (base<>R_NO) and (direction=dir_dec) then
                 begin
                   if (scalefactor = 1) or (scalefactor = 0) then
-                      s:=s+'-('+gas_reg2str[base]+')'
+                      s:=s+'-('+basestr+')'
                   else
                    InternalError(10003);
                 end
                   else if (index=R_NO) and (base<>R_NO) and (direction=dir_none) then
                 begin
-                  s:=s+'('+gas_reg2str[base]+')'
+                  s:=s+'('+basestr+')'
                 end
                   else if (index<>R_NO) and (base<>R_NO) and (direction=dir_none) then
                 begin
                   if (scalefactor = 1) or (scalefactor = 0) then
-                    s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index]+'.l)'
+                    s:=s+'('+basestr+','+indexstr+'.l)'
                   else
-                    s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index]+'.l*'+tostr(scalefactor)+')';
+                    s:=s+'('+basestr+','+indexstr+'.l*'+tostr(scalefactor)+')';
                 end;
             end; { end with }
          getreferencestring:=s;
@@ -255,7 +266,7 @@ unit ag68kgas;
               curr_n:=n_includefile;
              if (infile^.path^<>'') then
               begin
-                AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^)))+'",'+
+                AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^,false)))+'",'+
                   tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
               end;
              AsmWriteLn(#9'.stabs "'+lower(FixFileName(infile^.name^))+'",'+
@@ -482,8 +493,14 @@ ait_labeled_instruction : begin
                         AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+lab2str(pai_labeled(hp)^.lab))
                        else
                      { labeled operand with register }
-                        AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
-                                 reg2str(pai_labeled(hp)^._op1)+','+lab2str(pai_labeled(hp)^.lab))
+                        begin
+                           if target_info.target=target_m68k_PalmOS then
+                             AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
+                               gasPalmOS_reg2str[pai_labeled(hp)^._op1]+','+lab2str(pai_labeled(hp)^.lab))
+                           else
+                             AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
+                               gas_reg2str[pai_labeled(hp)^._op1]+','+lab2str(pai_labeled(hp)^.lab))
+                        end;
                      end;
         ait_symbol : begin
                        { ------------------------------------------------------- }
@@ -679,7 +696,11 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 {
   $Log$
-  Revision 1.18  1998-10-14 15:56:39  pierre
+  Revision 1.19  1998-10-29 11:35:36  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.18  1998/10/14 15:56:39  pierre
     * all references to comp suppressed for m68k
 
   Revision 1.17  1998/10/13 13:10:08  peter

+ 7 - 3
compiler/ag68kmit.pas

@@ -298,7 +298,7 @@ unit ag68kmit;
                    curr_n:=n_includefile;
                   if (infile^.path^<>'') then
                    begin
-                     AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^)))+'",'+
+                     AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^,false)))+'",'+
                        tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
                    end;
                   AsmWriteLn(#9'.stabs "'+lower(FixFileName(infile^.name^))+'",'+
@@ -496,7 +496,7 @@ ait_labeled_instruction : begin
                        else
                      { labeled operand with register }
                         AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
-                                 reg2str(pai_labeled(hp)^._op1)+','+lab2str(pai_labeled(hp)^.lab))
+                                 mit_reg2str[pai_labeled(hp)^._op1]+','+lab2str(pai_labeled(hp)^.lab))
                      end;
         ait_symbol : begin
                        { ------------------------------------------------------- }
@@ -658,7 +658,11 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 {
   $Log$
-  Revision 1.14  1998-10-14 15:56:40  pierre
+  Revision 1.15  1998-10-29 11:35:37  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.14  1998/10/14 15:56:40  pierre
     * all references to comp suppressed for m68k
 
   Revision 1.13  1998/10/12 12:20:44  pierre

+ 6 - 2
compiler/ag68kmot.pas

@@ -430,7 +430,7 @@ ait_labeled_instruction :
                         else
                       { labeled operand with register }
                          AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
-                                    reg2str(pai_labeled(hp)^._op1)+','+lab2str(pai_labeled(hp)^.lab))
+                                    mot_reg2str[pai_labeled(hp)^._op1]+','+lab2str(pai_labeled(hp)^.lab))
                      end;
         ait_symbol : begin
                        { ------------------------------------------------------- }
@@ -540,7 +540,11 @@ ait_labeled_instruction :
 end.
 {
   $Log$
-  Revision 1.12  1998-10-14 15:56:41  pierre
+  Revision 1.13  1998-10-29 11:35:38  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.12  1998/10/14 15:56:41  pierre
     * all references to comp suppressed for m68k
 
   Revision 1.11  1998/10/12 12:20:45  pierre

+ 6 - 2
compiler/ag68kmpw.pas

@@ -428,7 +428,7 @@ ait_labeled_instruction :
                         else
                       { labeled operand with register }
                          AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
-                                    reg2str(pai_labeled(hp)^._op1)+','+lab2str(pai_labeled(hp)^.lab))
+                                    mot_reg2str[pai_labeled(hp)^._op1]+','+lab2str(pai_labeled(hp)^.lab))
                      end;
         ait_symbol : begin
                        { ------------------------------------------------------- }
@@ -579,7 +579,11 @@ ait_labeled_instruction :
 end.
 {
   $Log$
-  Revision 1.5  1998-10-20 08:06:37  pierre
+  Revision 1.6  1998-10-29 11:35:39  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.5  1998/10/20 08:06:37  pierre
     * several memory corruptions due to double freemem solved
       => never use p^.loc.location:=p^.left^.loc.location;
     + finally I added now by default

+ 9 - 3
compiler/compiler.pas

@@ -90,7 +90,7 @@ uses
   browser,
 {$endif UseBrowser}
   dos,verbose,comphook,systems,
-  globals,options,parser,symtable,link,import;
+  globals,options,parser,symtable,link,import,export;
 
 function Compile(const cmd:string):longint;
 
@@ -127,6 +127,7 @@ begin
   linker.done;
   doneparser;
   DoneImport;
+  DoneExport;
 {$ifdef UseBrowser}
   DoneBrowser;
 {$endif UseBrowser}
@@ -149,7 +150,8 @@ begin
   read_arguments(cmd);
 { inits which depend on arguments }
   initparser;
-  initimport;
+  InitImport;
+  InitExport;
   CompilerInited:=true;
 end;
 
@@ -242,7 +244,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.14  1998-10-26 22:58:17  florian
+  Revision 1.15  1998-10-29 11:35:40  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.14  1998/10/26 22:58:17  florian
     * new introduded problem with classes fix, the parent class wasn't set
       correct, if the class was defined forward before
 

+ 22 - 19
compiler/export.pas

@@ -24,15 +24,16 @@ unit export;
 interface
 
 uses
-  cobjects;
+  cobjects,symtable;
 
 type
    pexported_procedure = ^texported_procedure;
    texported_procedure = object(tlinkedlist_item)
-      ordnr : word;
-      name,func : pstring;
-      lab : pointer; { should be plabel, but this gaves problems with circular units }
-      constructor init(const n,s : string;o : word);
+      sym : psym;
+      index : longint;
+      name : pstring;
+      options : word;
+      constructor init;
       destructor done;virtual;
    end;
 
@@ -40,8 +41,8 @@ type
    texportlib=object
       constructor Init;
       destructor Done;
-      procedure preparelib(const s:string);virtual;
-      procedure exportprocedure(const func:string;index:longint;const name:string);virtual;
+      procedure preparelib(const s : string);virtual;
+      procedure exportprocedure(hp : pexported_procedure);virtual;
       procedure generatelib;virtual;
    end;
 
@@ -54,7 +55,7 @@ procedure DoneExport;
 implementation
 
 uses
-  systems,verbose,globals
+  systems,verbose,globals,files
 {$ifdef i386}
   ,os2_targ
   ,win_targ
@@ -66,13 +67,13 @@ uses
                            TImported_procedure
 ****************************************************************************}
 
-constructor texported_procedure.init(const n,s : string;o : word);
+constructor texported_procedure.init;
 begin
   inherited init;
-  func:=stringdup(n);
-  name:=stringdup(s);
-  ordnr:=o;
-  lab:=nil;
+  sym:=nil;
+  index:=-1;
+  name:=nil;
+  options:=0;
 end;
 
 
@@ -103,9 +104,9 @@ begin
 end;
 
 
-procedure texportlib.exportprocedure(const func : string;index:longint;const name:string);
+procedure texportlib.exportprocedure(hp : pexported_procedure);
 begin
-  Message(exec_e_dll_not_supported);
+  current_module^._exports^.concat(hp);
 end;
 
 
@@ -137,10 +138,8 @@ begin
 }
 {$endif i386}
 {$ifdef m68k}
-{
     target_m68k_Linux :
-      importlib:=new(pimportliblinux,Init);
-}
+      exportlib:=new(pexportlib,Init);
 {$endif m68k}
     else
       exportlib:=new(pexportlib,Init);
@@ -151,7 +150,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  1998-10-27 10:22:34  florian
+  Revision 1.2  1998-10-29 11:35:43  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.1  1998/10/27 10:22:34  florian
     + First things for win32 export sections
 
 }

+ 7 - 2
compiler/files.pas

@@ -132,7 +132,7 @@ unit files;
           in_second_compile,        { is this unit being compiled for the 2nd time? }
           in_implementation,        { processing the implementation part? }
           in_global     : boolean;  { allow global settings }
-
+          islibrary     : boolean;  { if it is a library (win32 dll) }
           map           : punitmap; { mapping of all used units }
           unitcount     : word;     { local unit counter }
           unit_index    : word;     { global counter for browser }
@@ -935,6 +935,7 @@ unit files;
          in_implementation:=false;
          in_global:=true;
          is_unit:=_is_unit;
+         islibrary:=false;
          uses_imports:=false;
          imports:=new(plinkedlist,init);
        { search the PPU file if it is an unit }
@@ -1023,7 +1024,11 @@ unit files;
 end.
 {
   $Log$
-  Revision 1.68  1998-10-27 10:22:34  florian
+  Revision 1.69  1998-10-29 11:35:44  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.68  1998/10/27 10:22:34  florian
     + First things for win32 export sections
 
   Revision 1.67  1998/10/26 22:23:29  peter

+ 6 - 2
compiler/m68k.pas

@@ -878,7 +878,7 @@ type
        'SSP','DFC','SFC','VBR','FPSR');
 
       begin
-     reg2str:=a[r];
+         reg2str:=a[r];
       end;
 
     procedure disposereference(var r : preference);
@@ -1608,7 +1608,11 @@ type
 end.
 {
   $Log$
-  Revision 1.9  1998-10-14 08:47:18  pierre
+  Revision 1.10  1998-10-29 11:35:45  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.9  1998/10/14 08:47:18  pierre
     * bugs in secondfuncret for result in subprocedures removed
 
   Revision 1.8  1998/10/13 16:50:15  pierre

+ 2 - 0
compiler/msgidx.inc

@@ -417,6 +417,8 @@ type tmsgconst=(
   exec_w_ar_not_found,
   exec_e_dll_not_supported,
   exec_i_closing_script,
+  execinfo_f_cant_process_executable,
+  execinfo_f_cant_open_executable,
   execinfo_x_codesize,
   execinfo_x_initdatasize,
   execinfo_x_uninitdatasize,

+ 61 - 58
compiler/msgtxt.inc

@@ -432,24 +432,26 @@ const msgtxt : array[0..00094,1..240] of char=(
   'W_ar not found, switching to external ar'#000+
   'E_Dynamic Libraries not ','supported'#000+
   'I_Closing script $1'#000+
+  'F_Can'#039't post process executable $1'#000+
+  'F_Can'#039't open executable $1'#000+
   'X_Size of Code: $1 bytes'#000+
   'X_Size of initialized data: $1 bytes'#000+
   'X_Size of uninitialized data: $1 bytes'#000+
   'X_Stack space reserved: $1 bytes'#000+
-  'X_Stack space commited: $1 bytes'#000+
+  'X_Stack space ','commited: $1 bytes'#000+
   'T_Unitsearch: $1'#000+
   'T_PPU Loading $1'#000+
-  'U_PPU Nam','e: $1'#000+
+  'U_PPU Name: $1'#000+
   'U_PPU Flags: $1'#000+
   'U_PPU Crc: $1'#000+
   'U_PPU Time: $1'#000+
   'U_PPU File too short'#000+
   'U_PPU Invalid Header (no PPU at the begin)'#000+
   'U_PPU Invalid Version $1'#000+
-  'U_PPU is compiled for an other processor'#000+
+  'U_PPU is compiled for an other process','or'#000+
   'U_PPU is compiled for an other target'#000+
   'U_PPU Source: $1'#000+
-  'U_Wr','iting $1'#000+
+  'U_Writing $1'#000+
   'F_Can'#039't Write PPU-File'#000+
   'F_reading PPU-File'#000+
   'F_unexpected end of PPU-File'#000+
@@ -457,178 +459,179 @@ const msgtxt : array[0..00094,1..240] of char=(
   'F_PPU Dbx count problem'#000+
   'E_Illegal unit name: $1'#000+
   'F_Too much units'#000+
-  'F_Circular unit reference between $1 and $2'#000+
-  'F_Can'#039't compile unit $','1, no sources available'#000+
+  'F_Ci','rcular unit reference between $1 and $2'#000+
+  'F_Can'#039't compile unit $1, no sources available'#000+
   'W_Compiling the system unit requires the -Us switch'#000+
   'F_There were $1 errors compiling module, stopping'#000+
   'U_Load from $1 ($2) unit $3'#000+
-  'U_Recompiling $1, checksum changed for $2'#000+
-  'U_Recompiling unit, static lib is older than',' ppufile'#000+
+  'U_Recompiling $1, checks','um changed for $2'#000+
+  'U_Recompiling unit, static lib is older than ppufile'#000+
   'U_Recompiling unit, shared lib is older than ppufile'#000+
   'U_Recompiling unit, obj and asm are older than ppufile'#000+
   'U_Recompiling unit, obj is older than asm'#000+
-  'U_Parsing interface of $1'#000+
+  'U_Parsing interface',' of $1'#000+
   'U_Parsing implementation of $1'#000+
-  'U_Second load for unit $','1'#000+
+  'U_Second load for unit $1'#000+
   'U_PPU Check file $1 time $2'#000+
   '$1 [options] <inputfile> [options]'#000+
   'W_Only one source file supported'#000+
   'W_DEF file can be created only for OS/2'#000+
-  'E_nested response files are not supported'#000+
+  'E_nested response files are not supporte','d'#000+
   'F_No source file name in command line'#000+
-  'E_Illegal parameter: $','1'#000+
+  'E_Illegal parameter: $1'#000+
   'H_-? writes help pages'#000+
   'F_Too many config files nested'#000+
   'F_Unable to open file $1'#000+
   'N_Reading further options from $1'#000+
   'W_Target is already set to: $1'#000+
-  'W_Shared libs not supported on DOS platform, reverting to static'#000+
+  'W_Shared libs not supported on D','OS platform, reverting to static'#000+
   'F_too many IF(N)DEFs'#000+
-  'F_too ma','ny ENDIFs'#000+
+  'F_too many ENDIFs'#000+
   'F_open conditional at the end of the file'#000+
   'W_Debug information generation is not supported by this executable'#000+
   'H_Try recompiling with -dGDB'#000+
-  'Free Pascal Compiler version $FPCVER [$FPCDATE] for $FPCTARGET'#000+
-  'Copyright (c) 1993-98 by Flor','ian Klaempfl'#000+
+  'Free Pascal Compiler version $','FPCVER [$FPCDATE] for $FPCTARGET'#000+
+  'Copyright (c) 1993-98 by Florian Klaempfl'#000+
   'Free Pascal Compiler version $FPCVER'#000+
   #000+
   'Compiler Date  : $FPCDATE'#000+
   'Compiler Target: $FPCTARGET'#000+
   #000+
   'This program comes under the GNU General Public Licence'#000+
-  'For more information read COPYING.FPC'#000+
+  'For more informa','tion read COPYING.FPC'#000+
   #000+
   'Report bugs,suggestions etc to:'#000+
-  '       ','         [email protected]'#000+
+  '                [email protected]'#000+
   '**0*_+ switch option on, - off'#000+
   '**1a_the compiler doesn'#039't delete the generated assembler file'#000+
-  '**2al_list sourcecode lines in assembler file'#000+
+  '**2al_list sourcecode lines in assembler fi','le'#000+
   '*t1b_use EMS'#000+
   '**1B_build all modules'#000+
-  '**1C_code generation op','tions'#000+
+  '**1C_code generation options'#000+
   '3*2CD_create dynamic library'#000+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#000+
   '**2Ci_IO-checking'#000+
   '**2Cn_omit linking stage'#000+
   '**2Co_check overflow of integer operations'#000+
-  '**2Cr_range checking'#000+
+  '**2Cr','_range checking'#000+
   '**2Cs<n>_set stack size to <n>'#000+
-  '**2Ct_stack che','cking'#000+
+  '**2Ct_stack checking'#000+
   '3*2CS_create static library'#000+
   '3*2Cx_use smartlinking'#000+
   '**1d<x>_defines the symbol <x>'#000+
   '*O1D_generate a DEF file'#000+
   '*O2Dd<x>_set description to <x>'#000+
   '*O2Dw_PM application'#000+
-  '**1e<x>_set path to executable'#000+
+  '**1e<x>_set ','path to executable'#000+
   '**1E_same as -Cn'#000+
-  '**1F_set file names and pa','ths'#000+
+  '**1F_set file names and paths'#000+
   '**2FD<x>_sets the directory where to search for compiler utilities'#000+
   '**2Fe<x>_redirect error output to <x>'#000+
   '**2FE<x>_set exe/unit output path to <x>'#000+
   '*L2Fg<x>_same as -Fl'#000+
-  '**2Fi<x>_adds <x> to include path'#000+
+  '**2Fi<x','>_adds <x> to include path'#000+
   '**2Fl<x>_adds <x> to library path'#000+
-  '*','L2FL<x>_uses <x> as dynamic linker'#000+
+  '*L2FL<x>_uses <x> as dynamic linker'#000+
   '**2Fo<x>_adds <x> to object path'#000+
   '**2Fr<x>_load error message file <x>'#000+
   '**2Fu<x>_adds <x> to unit path'#000+
-  '**2FU<x>_set unit output path to <x>, overrides -FE'#000+
+  '**2FU<x>_set unit output path to <x>, over','rides -FE'#000+
   '*g1g_generate debugger information'#000+
   '*g2gg_use gsym'#000+
-  '*g','2gd_use dbx'#000+
+  '*g2gd_use dbx'#000+
   '**1i_information'#000+
   '**1I<x>_adds <x> to include path'#000+
   '**1k<x>_Pass <x> to the linker'#000+
   '**1l_write logo'#000+
   '**1n_don'#039't read the default config file'#000+
-  '**1o<x>_change the name of the executable produced to <x>'#000+
-  '**1pg_generate profile code for g','prof'#000+
+  '**1o<x>_change the name of th','e executable produced to <x>'#000+
+  '**1pg_generate profile code for gprof'#000+
   '*L1P_use pipes instead of creating temporary assembler files'#000+
   '**1S_syntax options'#000+
   '**2S2_switch some Delphi 2 extensions on'#000+
   '**2Sc_supports operators like C (*=,+=,/= and -=)'#000+
-  '**2Sd_tries to be Delphi compatible'#000+
-  '**2Se_compiler stops after ','the first error'#000+
+  '*','*2Sd_tries to be Delphi compatible'#000+
+  '**2Se_compiler stops after the first error'#000+
   '**2Sg_allow LABEL and GOTO'#000+
   '**2Si_support C++ stlyed INLINE'#000+
   '**2Sm_support macros like C (global)'#000+
   '**2So_tries to be TP/BP 7.0 compatible'#000+
-  '**2Sp_tries to be gpc compatible'#000+
-  '**2Ss_constructor name must be init (destructor must be ','done)'#000+
+  '**2Sp_tries to be gpc compa','tible'#000+
+  '**2Ss_constructor name must be init (destructor must be done)'#000+
   '**2St_allow static keyword in objects'#000+
   '**2Sv_allow variable directives (cvar,external,public,export)'#000+
   '**1s_don'#039't call assembler and linker (only with -a)'#000+
-  '**1u<x>_undefines the symbol <x>'#000+
+  '**1u<x>_undefines th','e symbol <x>'#000+
   '**1U_unit options'#000+
-  '**2Un_don'#039't check the unit name',#000+
+  '**2Un_don'#039't check the unit name'#000+
   '**2Up<x>_same as -Fu<x>'#000+
   '**2Us_compile a system unit'#000+
   '**1v<x>_Be verbose. <x> is a combination of the following letters :'#000+
-  '**2*_e : Show errors (default)       d : Show debug info'#000+
+  '**2*_e : Show errors (default)       d : Show debug info'#000,+
   '**2*_w : Show warnings               u : Show unit info'#000+
-  '**2*_n',' : Show notes                  t : Show tried/used files'#000+
+  '**2*_n : Show notes                  t : Show tried/used files'#000+
   '**2*_h : Show hints                  m : Show defined macros'#000+
-  '**2*_i : Show general info           p : Show compiled procedures'#000+
-  '**2*_l : Show linenumbers            c : Show conditiona','ls'#000+
+  '**2*_i : Show general info           p : Show compiled proce','dures'#000+
+  '**2*_l : Show linenumbers            c : Show conditionals'#000+
   '**2*_a : Show everything             0 : Show nothing (except errors)'#000+
   '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#000+
-  '**2*_    declarations if an error    x : Executable info (Win32 only)'#000+
+  '**2*_    declarations if an error  ','  x : Executable info (Win32 only'+
+  ')'#000+
   '**2*_    occurs'#000+
-  '**1X_execut','able options'#000+
+  '**1X_executable options'#000+
   '*L2Xc_link with the c library'#000+
   '**2XD_link with dynamic libraries (defines FPC_LINK_DYNAMIC)'#000+
   '**2Xs_strip all symbols from executable'#000+
-  '**2XS_link with static libraries (defines FPC_LINK_STATIC)'#000+
+  '**2XS_link with static libraries (','defines FPC_LINK_STATIC)'#000+
   '**0*_Processor specific options:'#000+
-  '3*1A','<x>_output format'#000+
+  '3*1A<x>_output format'#000+
   '3*2Ao_coff file using GNU AS'#000+
   '3*2Anasmcoff_coff file using Nasm'#000+
   '3*2Anasmelf_elf32 (linux) file using Nasm'#000+
   '3*2Anasmobj_obj file using Nasm'#000+
-  '3*2Amasm_obj using Masm (Mircosoft)'#000+
+  '3*2Amasm_obj using Masm',' (Mircosoft)'#000+
   '3*2Atasm_obj using Tasm (Borland)'#000+
-  '3*1R<x>_assembl','er reading style'#000+
+  '3*1R<x>_assembler reading style'#000+
   '3*2Ratt_read AT&T style assembler'#000+
   '3*2Rintel_read Intel style assembler'#000+
   '3*2Rdirect_copy assembler text directly to assembler file'#000+
   '3*1O<x>_optimizations'#000+
-  '3*2Og_generate smaller code'#000+
+  '3*2Og_gene','rate smaller code'#000+
   '3*2OG_generate faster code (default)'#000+
-  '3*2Or_k','eep certain variables in registers (still BUGGY!!!)'#000+
+  '3*2Or_keep certain variables in registers (still BUGGY!!!)'#000+
   '3*2Ou_enable uncertain optimizations (see docs)'#000+
   '3*2O1_level 1 optimizations (quick optimizations)'#000+
-  '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#000+
-  '3*2O3_level 3 optimizations (same',' as -O2u)'#000+
+  '3*2O2_level 2 optimizations ','(-O1 + slower optimizations)'#000+
+  '3*2O3_level 3 optimizations (same as -O2u)'#000+
   '3*2Op_target processor'#000+
   '3*3Op1_set target processor to 386/486'#000+
   '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#000+
-  '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#000+
+  '3*3Op3_set target processor to PPro/PII/c6x86/K6 (t','m)'#000+
   '3*1T<x>_Target operating system'#000+
-  '3*2TGO32V1_version 1 of DJ ','Delorie DOS extender'#000+
+  '3*2TGO32V1_version 1 of DJ Delorie DOS extender'#000+
   '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#000+
   '3*2TLINUX_Linux'#000+
   '3*2TOS2_OS/2 2.x'#000+
   '3*2TWin32_Windows 32 Bit'#000+
   '6*1A<x>_output format'#000+
-  '6*2Ao_Unix o-file using GNU AS'#000+
+  '6*2Ao_Unix o-file using GNU A','S'#000+
   '6*2Agas_GNU Motorola assembler'#000+
-  '6*2Amit_MIT Syntax (old GAS)'#000,+
+  '6*2Amit_MIT Syntax (old GAS)'#000+
   '6*2Amot_Standard Motorola assembler'#000+
   '6*1O_optimizations'#000+
   '6*2Oa_turn on the optimizer'#000+
   '6*2Og_generate smaller code'#000+
   '6*2OG_generate faster code (default)'#000+
-  '6*2Ox_optimize maximum (still BUGGY!!!)'#000+
+  '6*2Ox_optimize maximum (still ','BUGGY!!!)'#000+
   '6*2O2_set target processor to a MC68020+'#000+
-  '6*1R<x>_ass','embler reading style'#000+
+  '6*1R<x>_assembler reading style'#000+
   '6*2RMOT_read motorola style assembler'#000+
   '6*1T<x>_Target operating system'#000+
   '6*2TAMIGA_Commodore Amiga'#000+
   '6*2TATARI_Atari ST/STe/TT'#000+
   '6*2TMACOS_Macintosh m68k'#000+
-  '6*2TLINUX_Linux-68k'#000+
+  '6*2TLINUX_','Linux-68k'#000+
   '**1*_'#000+
   '**1?_shows this help'#000+
-  '**1h_shows this help with','out waiting'#000
+  '**1h_shows this help without waiting'#000
 );

+ 9 - 31
compiler/pexports.pas

@@ -30,46 +30,23 @@ unit pexports;
   implementation
 
     uses
-       cobjects,globals,scanner,symtable,pbase,verbose;
+       cobjects,globals,scanner,symtable,pbase,verbose,export;
 
     const
        { export options }
        eo_resident = $1;
 
-    type
-       pexportsitem = ^texportsitem;
-
-       texportsitem = object(tlinkedlist_item)
-          sym : psym;
-          index : longint;
-          name : pstring;
-          options : word;
-          constructor init;
-       end;
-
-    var
-       exportslist : tlinkedlist;
-
-    constructor texportsitem.init;
-
-      begin
-         sym:=nil;
-         index:=-1;
-         name:=nil;
-         options:=0;
-      end;
-
     procedure read_exports;
 
       var
-         hp : pexportsitem;
+         hp : pexported_procedure;
          code : word;
 
       begin
-         hp:=new(pexportsitem,init);
          consume(_EXPORTS);
          while true do
            begin
+              hp:=new(pexported_procedure,init);
               if token=ID then
                 begin
                    getsym(pattern,true);
@@ -104,6 +81,7 @@ unit pexports;
                              hp^.options:=hp^.options or eo_resident;
                           end;
                      end;
+                   exportlib^.exportprocedure(hp);
                 end
               else
                 consume(ID);
@@ -115,15 +93,15 @@ unit pexports;
          consume(SEMICOLON);
       end;
 
-begin
-   { a library is a root of sources, e.g. it can't be used
-     twice in one compiler run }
-   exportslist.init;
 end.
 
 {
   $Log$
-  Revision 1.2  1998-09-26 17:45:35  peter
+  Revision 1.3  1998-10-29 11:35:51  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.2  1998/09/26 17:45:35  peter
     + idtoken and only one token table
 
 }

+ 18 - 5
compiler/pmodules.pas

@@ -125,21 +125,29 @@ unit pmodules;
           not output a pointer }
          case target_info.target of
 {$ifdef i386}
-       target_i386_OS2 : ;
+            target_i386_OS2:
+              ;
 {$endif i386}
 {$ifdef m68k}
-       target_m68k_Mac : bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
+            target_m68k_Mac:
+              bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
+            target_m68k_PalmOS:
+              ;
 {$endif m68k}
          else
            bsssegment^.concat(new(pai_datablock,init_global('HEAP',heapsize)));
          end;
 {$ifdef i386}
          datasegment^.concat(new(pai_symbol,init_global('HEAPSIZE')));
+         datasegment^.concat(new(pai_const,init_32bit(heapsize)));
 {$endif i386}
 {$ifdef m68k}
-         datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE')));
+         if target_info.target<>target_m68k_PalmOS then
+           begin
+              datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE')));
+              datasegment^.concat(new(pai_const,init_32bit(heapsize)));
+           end;
 {$endif m68k}
-         datasegment^.concat(new(pai_const,init_32bit(heapsize)));
       end;
 
 
@@ -975,6 +983,7 @@ unit pmodules;
               consume(_LIBRARY);
               stringdispose(current_module^.modulename);
               current_module^.modulename:=stringdup(pattern);
+              current_module^.islibrary:=true;
               consume(ID);
               consume(SEMICOLON);
            end
@@ -1101,7 +1110,11 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.76  1998-10-28 18:26:15  pierre
+  Revision 1.77  1998-10-29 11:35:52  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.76  1998/10/28 18:26:15  pierre
    * removed some erros after other errors (introduced by useexcept)
    * stabs works again correctly (for how long !)
 

+ 11 - 10
compiler/win_targ.pas

@@ -39,8 +39,6 @@ unit win_targ;
     pexportlibwin32=^texportlibwin32;
     texportlibwin32=object(texportlib)
       procedure preparelib(const s:string);virtual;
-      procedure exportprocedure(const func : string;
-        index : longint;const name : string);virtual;
       procedure generatelib;virtual;
     end;
 
@@ -364,12 +362,6 @@ unit win_targ;
            exportssection:=new(paasmoutput,init);
       end;
 
-    procedure texportlibwin32.exportprocedure(const func : string;
-      index : longint;const name : string);
-
-      begin
-      end;
-
     procedure texportlibwin32.generatelib;
 
       var
@@ -404,10 +396,10 @@ unit win_targ;
          importssection^.concat(new(pai_const,init_rva(strpnew(lab2str(l3)))));
          { address of ordinal number pointers }
          importssection^.concat(new(pai_const,init_rva(strpnew(lab2str(l4)))));
-
          { the name }
          importssection^.concat(new(pai_label,init(l1)));
          importssection^.concat(new(pai_string,init(current_module^.modulename^+target_os.sharedlibext+#0)));
+
       end;
 
     procedure postprocessexecutable(n : string);
@@ -420,7 +412,10 @@ unit win_targ;
 
       begin
          assign(f,n);
+         {$i-}
          reset(f,1);
+         if ioresult<>0 then
+           Message1(execinfo_f_cant_open_executable,n);
          blockread(f,dosheader,sizeof(tdosheader));
          peheaderpos:=dosheader.e_lfanew;
          seek(f,peheaderpos);
@@ -445,12 +440,18 @@ unit win_targ;
          seek(f,peheaderpos);
          blockwrite(f,peheader,sizeof(tpeheader));
          close(f);
+         if ioresult<>0 then
+           Message1(execinfo_f_cant_process_executable,n);
       end;
 
 end.
 {
   $Log$
-  Revision 1.12  1998-10-27 10:22:35  florian
+  Revision 1.13  1998-10-29 11:35:54  florian
+    * some dll support for win32
+    * fixed assembler writing for PalmOS
+
+  Revision 1.12  1998/10/27 10:22:35  florian
     + First things for win32 export sections
 
   Revision 1.11  1998/10/22 17:54:09  florian