Browse Source

* fixed stripping symbols for OS/2

Tomas Hajny 26 years ago
parent
commit
1af2afef91
2 changed files with 136 additions and 3 deletions
  1. 9 2
      compiler/link.pas
  2. 127 1
      compiler/systems.pas

+ 9 - 2
compiler/link.pas

@@ -373,7 +373,8 @@ begin
 { Fix command line options }
   If not SharedLibFiles.Empty then
    LinkOptions:='-dynamic-linker='+DynamicLinker+' '+LinkOptions;
-  if Strip and not(cs_debuginfo in aktmoduleswitches) then
+  if Strip and not(cs_debuginfo in aktmoduleswitches) and
+                           not (Target_Link.StripBind) then
    LinkOptions:=LinkOptions+' '+target_link.stripopt;
 
 { Open linkresponse and write header }
@@ -533,6 +534,9 @@ begin
      {When an EMX program runs in DOS, the heap and stack share the
       same memory pool. The heap grows upwards, the stack grows downwards.}
      Replace(s,'$DOSHEAPKB',tostr((stacksize+maxheapsize+1023) shr 10));
+     if Strip and Target_Link.StripBind then
+                   Replace (S, '$STRIP', Target_Link.StripOpt) else
+                                                     Replace (S, '$STRIP', '');
      if utilsdirectory<>'' then
        begin
           bindbin:=Search(target_link.bindbin[ii]+source_os.exeext,
@@ -640,7 +644,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.53  1999-05-04 21:44:44  florian
+  Revision 1.54  1999-06-02 13:25:35  hajny
+    * fixed stripping symbols for OS/2
+
+  Revision 1.53  1999/05/04 21:44:44  florian
     * changes to compile it with Delphi 4.0
 
   Revision 1.52  1999/05/03 21:30:30  peter

+ 127 - 1
compiler/systems.pas

@@ -1,4 +1,5 @@
 {
+    $Id$
     $Id$
     Copyright (C) 1995,97 by Florian Klaempfl
 
@@ -71,6 +72,7 @@ unit systems;
      type
        tasm = (as_none
             ,as_i386_as,as_i386_as_aout,as_i386_asw,
+            ,as_i386_o,as_i386_o_aout,as_i386_asw,
             as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
             as_i386_tasm,as_i386_masm,
             as_i386_dbg,as_i386_coff,as_i386_pecoff
@@ -79,6 +81,11 @@ unit systems;
        { binary assembler writers, needed to test for -a }
      const
        {$ifdef i386} i386asmcnt=11; {$else} i386asmcnt=0; {$endif}
+            as_i386_coff
+            ,as_m68k_o,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw
+       );
+     const
+       {$ifdef i386} i386asmcnt=9; {$else} i386asmcnt=0; {$endif}
        {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
        asmcnt=i386asmcnt+m68kasmcnt+1;
 
@@ -135,6 +142,7 @@ unit systems;
           name      : string[30];
           shortname : string[8];
           sharedlibext : string[10];
+          sharedlibext,
           staticlibext,
           sourceext,
           pasext,
@@ -160,6 +168,7 @@ unit systems;
           allowdirect,
           externals,
           needar      : boolean;
+          externals   : boolean;
           labelprefix : string[2];
           comment     : string[2];
           secnames    : array[tsection] of string[20];
@@ -173,6 +182,7 @@ unit systems;
           bindbin       : array[1..2]of string[8];
           bindcmd       : array[1..2]of string[127];
           stripopt      : string[2];
+          stripbind     : boolean;     (* Strip symbols in binder?        *)
           libpathprefix : string[13];
           libpathsuffix : string[2];
           groupstart    : string[8];
@@ -247,6 +257,9 @@ unit systems;
     function set_string_asmmode(s:string;var t:tasmmode):boolean;
 
     procedure InitSystems;
+    function set_string_target(s : string) : boolean;
+    function set_string_asm(s : string) : boolean;
+    function set_string_asmmode(s:string;var t:tasmmode):boolean;
 
 
 implementation
@@ -302,6 +315,15 @@ implementation
             size_of_pointer : 4;
             size_of_longint : 4;
             use_bound_instruction : false;
+            scriptext    : '.bat';
+            libprefix    : '';
+            Cprefix      : '_';
+            newline      : #13#10;
+            endian       : endian_little;
+            stackalignment : 2;
+            size_of_pointer : 4;
+            size_of_longint : 4;
+            use_bound_instruction : true;
             use_function_relative_addresses : true
           ),
           (
@@ -365,6 +387,15 @@ implementation
             size_of_pointer : 4;
             size_of_longint : 4;
             use_bound_instruction : false;
+            scriptext    : '.bat';
+            libprefix    : 'lib';
+            Cprefix      : '_';
+            newline      : #13#10;
+            endian       : endian_little;
+            stackalignment : 4;
+            size_of_pointer : 4;
+            size_of_longint : 4;
+            use_bound_instruction : true;
             use_function_relative_addresses : true
           ),
           (
@@ -514,6 +545,22 @@ implementation
               '.text','.data','.bss',
               '','','','','','',
               '.stab','.stabstr')
+            id     : as_i386_o;
+            idtxt  : 'O';
+            asmbin : 'as';
+            asmcmd : '-o $OBJ $ASM';
+            externals : false;
+            labelprefix : '.L';
+            comment : '# '
+          )
+          ,(
+            id     : as_i386_o_aout;
+            idtxt  : 'O_AOUT';
+            asmbin : 'as';
+            asmcmd : '-o $OBJ $ASM';
+            externals : false;
+            labelprefix : 'L';
+            comment : '# '
           )
           ,(
             id     : as_i386_asw;
@@ -530,6 +577,9 @@ implementation
               '.section .idata$2','.section .idata$4','.section .idata$5',
                 '.section .idata$6','.section .idata$7','.section .edata',
               '.stab','.stabstr')
+            externals : false;
+            labelprefix : '.L';
+            comment : '# '
           )
           ,(
             id     : as_i386_nasmcoff;
@@ -545,6 +595,9 @@ implementation
               '.text','.data','.bss',
               '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
               '.stab','.stabstr')
+            externals : true;
+            labelprefix : 'L';
+            comment : '; '
           )
           ,(
             id     : as_i386_nasmelf;
@@ -560,6 +613,9 @@ implementation
               '.text','.data','.bss',
               '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
               '.stab','.stabstr')
+            externals : true;
+            labelprefix : 'L';
+            comment : '; '
           )
           ,(
             id     : as_i386_nasmobj;
@@ -575,6 +631,9 @@ implementation
               '.text','.data','.bss',
               '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
               '.stab','.stabstr')
+            externals : true;
+            labelprefix : 'L';
+            comment : '; '
           )
           ,(
             id     : as_i386_tasm;
@@ -590,6 +649,9 @@ implementation
               'CODE','DATA','BSS',
               '','','','','','',
               '','')
+            externals : true;
+            labelprefix : '.L';
+            comment : '; '
           )
           ,(
             id     : as_i386_masm;
@@ -620,6 +682,9 @@ implementation
               '.text','.data','.bss',
               '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
               '.stab','.stabstr')
+            externals : true;
+            labelprefix : '.L';
+            comment : '; '
           )
           ,(
             id     : as_i386_coff;
@@ -667,6 +732,22 @@ implementation
               '.text','.data','.bss',
               '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
               '.stab','.stabstr')
+            asmbin : 'as';
+            asmcmd : '-o $OBJ $ASM';
+            externals : false;
+            labelprefix : '.L';
+            comment : '# '
+          )
+{$endif i386}
+{$ifdef m68k}
+          ,(
+            id     : as_m68k_o;
+            idtxt  : 'O';
+            asmbin : 'as';
+            asmcmd : '-o $OBJ $ASM';
+            externals : false;
+            labelprefix : '.L';
+            comment : '# '
           )
           ,(
             id     : as_m68k_gas;
@@ -682,6 +763,9 @@ implementation
               '.text','.data','.bss',
               '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
               '.stab','.stabstr')
+            externals : false;
+            labelprefix : '.L';
+            comment : '| '
           )
           ,(
             id     : as_m68k_mit;
@@ -697,6 +781,9 @@ implementation
               '.text','.data','.bss',
               '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
               '.stab','.stabstr')
+            externals : false;
+            labelprefix : '.L';
+            comment : '| '
           )
           ,(
             id     : as_m68k_mot;
@@ -712,6 +799,9 @@ implementation
               '.text','.data','.bss',
               '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
               '.stab','.stabstr')
+            externals : false;
+            labelprefix : '__L';
+            comment : '| '
           )
           ,(
             id     : as_m68k_mpw;
@@ -727,6 +817,9 @@ implementation
               '.text','.data','.bss',
               '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
               '.stab','.stabstr')
+            externals : false;
+            labelprefix : '__L';
+            comment : '| '
           )
 {$endif m68k}
           );
@@ -749,6 +842,7 @@ implementation
             bindbin : ('','');
             bindcmd : ('','');
             stripopt   : '-s';
+            stripbind  : false;
             libpathprefix : 'SEARCH_DIR(';
             libpathsuffix : ')';
             groupstart : 'GROUP(';
@@ -765,6 +859,7 @@ implementation
             bindbin : ('aout2exe','');
             bindcmd : ('$EXE','');
             stripopt   : '-s';
+            stripbind  : false;
             libpathprefix : '-L';
             libpathsuffix : '';
             groupstart : '-(';
@@ -781,6 +876,7 @@ implementation
             bindbin : ('','');
             bindcmd : ('','');
             stripopt   : '-s';
+            stripbind  : false;
             libpathprefix : '-L';
             libpathsuffix : '';
             groupstart : '-(';
@@ -798,6 +894,7 @@ implementation
             bindcmd : ('--as asw.exe --dllname $EXE --output-exp exp.$$$',
                        '-s $OPT -o $EXE $RES exp.$$$');
             stripopt   : '-s';
+            stripbind  : false;
             libpathprefix : 'SEARCH_DIR(';
             libpathsuffix : ')';
             groupstart : 'GROUP(';
@@ -814,6 +911,9 @@ implementation
             bindbin : ('emxbind','');
             bindcmd : ('-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB','');
             stripopt   : '-s';
+            bindcmd : ('-b $STRIP -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB','');
+            stripopt   : '-s';
+            stripbind  : true;
             libpathprefix : '-L';
             libpathsuffix : '';
             groupstart : ''; {Linker is too primitive...}
@@ -832,6 +932,7 @@ implementation
             bindbin : ('','');
             bindcmd : ('','');
             stripopt   : '-s';
+            stripbind  : false;
             libpathprefix : 'SEARCH_DIR(';
             libpathsuffix : ')';
             groupstart : 'GROUP(';
@@ -922,6 +1023,10 @@ implementation
             ar    : ar_i386_ar;
             res  : res_none;
             heapsize    : 256*1024;
+            assem       : as_i386_o;
+            ar          : ar_i386_ar;
+            res         : res_none;
+            heapsize    : 2048*1024;
             maxheapsize : 32768*1024;
             stacksize   : 16384
           ),
@@ -947,6 +1052,10 @@ implementation
             ar    : ar_i386_ar;
             res  : res_none;
             heapsize    : 256*1024;
+            assem       : as_i386_o;
+            ar          : ar_i386_ar;
+            res         : res_none;
+            heapsize    : 2048*1024;
             maxheapsize : 32768*1024;
             stacksize   : 16384
           ),
@@ -972,6 +1081,10 @@ implementation
             ar    : ar_i386_ar;
             res  : res_none;
             heapsize    : 256*1024;
+            assem       : as_i386_o;
+            ar          : ar_i386_ar;
+            res         : res_none;
+            heapsize    : 2048*1024;
             maxheapsize : 32768*1024;
             stacksize   : 8192
           ),
@@ -994,6 +1107,7 @@ implementation
             link        : link_i386_ldos2;
             assem       : as_i386_as_aout;
             assemsrc    : as_i386_as_aout;
+            assem       : as_i386_o_aout;
             ar    : ar_i386_ar;
             res  : res_none;
             heapsize    : 256*1024;
@@ -1019,11 +1133,15 @@ implementation
             link        : link_i386_ldw;
             assem       : as_i386_pecoff;
             assemsrc    : as_i386_asw;
+            assem       : as_i386_asw;
             ar    : ar_i386_arw;
             res  : res_i386_windres;
             heapsize    : 256*1024;
             maxheapsize : 32*1024*1024;
             stacksize   : 32*1024*1024
+            heapsize    : 2048*1024;
+            maxheapsize : 32768*1024;
+            stacksize   : 32768
           )
 {$endif i386}
 {$ifdef m68k}
@@ -1046,6 +1164,7 @@ implementation
             link        : link_m68k_ld;
             assem       : as_m68k_as;
             assemsrc    : as_m68k_as;
+            assem       : as_m68k_o;
             ar    : ar_m68k_ar;
             res  : res_none;
             heapsize    : 128*1024;
@@ -1071,6 +1190,7 @@ implementation
             link        : link_m68k_ld;
             assem       : as_m68k_as;
             assemsrc    : as_m68k_as;
+            assem       : as_m68k_o;
             ar    : ar_m68k_ar;
             res  : res_none;
             heapsize    : 16*1024;
@@ -1121,6 +1241,7 @@ implementation
             link        : link_m68k_ld;
             assem       : as_m68k_as;
             assemsrc    : as_m68k_as;
+            assem       : as_m68k_o;
             ar    : ar_m68k_ar;
             res  : res_none;
             heapsize    : 128*1024;
@@ -1146,6 +1267,7 @@ implementation
             link        : link_m68k_ld;
             assem       : as_m68k_as;
             assemsrc    : as_m68k_as;
+            assem       : as_m68k_o;
             ar    : ar_m68k_ar;
             res  : res_none;
             heapsize    : 128*1024;
@@ -1410,6 +1532,7 @@ begin
         set_source_os(os_i386_OS2);
         if (OS_Mode = osDOS) or (OS_Mode = osDPMI)
                                             then source_os.scriptext := '.bat';
+        if OS_Mode = osDOS then source_os.scriptext := '.bat';
 {OS/2 via EMX can be run under DOS as well}
       {$else}
         {$ifdef LINUX}
@@ -1492,7 +1615,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.78  1999-05-31 20:34:00  peter
+  Revision 1.79  1999-06-02 13:25:34  hajny
+    * fixed stripping symbols for OS/2
+
+  Revision 1.78  1999/05/31 20:34:00  peter
     * changed heapsize to 256k
 
   Revision 1.77  1999/05/27 19:45:10  peter