Quellcode durchsuchen

+ Pavel's changes to support reloc section in exes

pierre vor 26 Jahren
Ursprung
Commit
50193df98e
1 geänderte Dateien mit 20 neuen und 5 gelöschten Zeilen
  1. 20 5
      compiler/t_win32.pas

+ 20 - 5
compiler/t_win32.pas

@@ -632,8 +632,13 @@ begin
    begin
    begin
      ExeCmd[1]:='ldw $OPT $STRIP $APPTYPE $IMAGEBASE $RELOC -o $EXE $RES';
      ExeCmd[1]:='ldw $OPT $STRIP $APPTYPE $IMAGEBASE $RELOC -o $EXE $RES';
      DllCmd[1]:='ldw $OPT --dll $APPTYPE $IMAGEBASE $RELOC -o $EXE $RES';
      DllCmd[1]:='ldw $OPT --dll $APPTYPE $IMAGEBASE $RELOC -o $EXE $RES';
-     DllCmd[2]:='dlltool --as asw.exe --dllname $EXE --output-exp exp.$$$ $RELOC -d $DEF';
-     DllCmd[3]:='ldw $OPT $STRIP --dll $APPTYPE $IMAGEBASE -o $EXE $RES exp.$$$';
+     if RelocSection then
+       begin
+          ExeCmd[2]:='dlltool --as asw.exe --dllname $EXE --output-exp exp.$$$ $RELOC $DEF';
+          ExeCmd[3]:='ldw $OPT $STRIP $APPTYPE $IMAGEBASE -o $EXE $RES exp.$$$';
+          DllCmd[2]:='dlltool --as asw.exe --dllname $EXE --output-exp exp.$$$ $RELOC $DEF';
+          DllCmd[3]:='ldw $OPT $STRIP --dll $APPTYPE $IMAGEBASE -o $EXE $RES exp.$$$';
+       end;
    end;
    end;
 end;
 end;
 
 
@@ -755,7 +760,7 @@ begin
 
 
 { Call linker }
 { Call linker }
   success:=false;
   success:=false;
-  for i:=1to 1 do
+  for i:=1 to 3 do
    begin
    begin
      SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
      SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
      if binstr<>'' then
      if binstr<>'' then
@@ -767,6 +772,10 @@ begin
         Replace(cmdstr,'$RELOC',RelocStr);
         Replace(cmdstr,'$RELOC',RelocStr);
         Replace(cmdstr,'$IMAGEBASE',ImageBaseStr);
         Replace(cmdstr,'$IMAGEBASE',ImageBaseStr);
         Replace(cmdstr,'$STRIP',StripStr);
         Replace(cmdstr,'$STRIP',StripStr);
+        if not DefFile.Empty then
+          Replace(cmdstr,'$DEF','-d '+deffile.fname)
+        else
+          Replace(cmdstr,'$DEF','');
         success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
         success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
         if not success then
         if not success then
          break;
          break;
@@ -835,7 +844,10 @@ begin
         Replace(cmdstr,'$RELOC',RelocStr);
         Replace(cmdstr,'$RELOC',RelocStr);
         Replace(cmdstr,'$IMAGEBASE',ImageBaseStr);
         Replace(cmdstr,'$IMAGEBASE',ImageBaseStr);
         Replace(cmdstr,'$STRIP',StripStr);
         Replace(cmdstr,'$STRIP',StripStr);
-        Replace(cmdstr,'$DEF',deffile.fname);
+        if not DefFile.Empty then
+          Replace(cmdstr,'$DEF','-d '+deffile.fname)
+        else
+          Replace(cmdstr,'$DEF','');
         success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
         success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
         if not success then
         if not success then
          break;
          break;
@@ -1044,7 +1056,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-11-12 11:03:50  peter
+  Revision 1.7  1999-11-15 15:01:56  pierre
+   + Pavel's changes to support reloc section in exes
+
+  Revision 1.6  1999/11/12 11:03:50  peter
     * searchpaths changed to stringqueue object
     * searchpaths changed to stringqueue object
 
 
   Revision 1.5  1999/11/04 10:55:31  peter
   Revision 1.5  1999/11/04 10:55:31  peter