Kaynağa Gözat

Added some comments.

Martijn Laan 10 yıl önce
ebeveyn
işleme
6e3f9a81a4
2 değiştirilmiş dosya ile 9 ekleme ve 0 silme
  1. 3 0
      Projects/Compile.pas
  2. 6 0
      compile-unicode.bat

+ 3 - 0
Projects/Compile.pas

@@ -865,6 +865,9 @@ begin
         F.Seek(Ofs + OffsetOfDllCharacteristics);
         F.Seek(Ofs + OffsetOfDllCharacteristics);
         if F.Read(DllChars, SizeOf(DllChars)) = SizeOf(DllChars) then begin
         if F.Read(DllChars, SizeOf(DllChars)) = SizeOf(DllChars) then begin
           OrigDllChars := DllChars;
           OrigDllChars := DllChars;
+          { Note: because we stripped relocations from Setup(Ldr).e32 during
+            compilation IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE won't actually
+            enable ASLR, but setting it anyway to make checkers happy. }
           DllChars := DllChars or IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE or IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
           DllChars := DllChars or IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE or IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
           if IsTSAware then
           if IsTSAware then
             DllChars := DllChars or IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE
             DllChars := DllChars or IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE

+ 6 - 0
compile-unicode.bat

@@ -30,6 +30,12 @@ rem -------------------------------------------------------------------------
 rem  Compile each project separately because it seems Delphi
 rem  Compile each project separately because it seems Delphi
 rem  carries some settings (e.g. $APPTYPE) between projects
 rem  carries some settings (e.g. $APPTYPE) between projects
 rem  if multiple projects are specified on the command line.
 rem  if multiple projects are specified on the command line.
+rem  Note:
+rem  Command line parameter "--peflags:1" below equals the
+rem  {$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED} directive.
+rem  This causes the Delphi compiler to not just set the flag
+rem  but also it actually strips relocations. Used instead of
+rem  calling StripReloc like compile.bat does.
 
 
 cd Projects
 cd Projects
 if errorlevel 1 goto exit
 if errorlevel 1 goto exit