Просмотр исходного кода

* set the size of the (invalid) page at address zero to 64kb for 32 bit
Darwin platforms, so that no data can be placed below that address.
This fixes the strange Windows-compatible resource API, which
assumes that addresses <64kb do not exist.

git-svn-id: trunk@13600 -

Jonas Maebe 16 лет назад
Родитель
Сommit
ec8364904c
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      compiler/systems/t_bsd.pas

+ 12 - 0
compiler/systems/t_bsd.pas

@@ -152,7 +152,19 @@ begin
            end
          else
            begin
+{$ifndef cpu64bitaddr}
+             { Set the size of the page at address zero to 64kb, so nothing
+               is loaded below that address. This avoids problems with the
+               strange Windows-compatible resource handling that assumes
+               that addresses below 64kb do not exist.
+               
+               On 64bit systems, page zero is 4GB by default, so no problems
+               there.
+             }
+             ExeCmd[1]:='ld $PRTOBJ $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -pagezero_size 0x10000 -no_dead_strip_inits_and_terms -multiply_defined suppress -L. -o $EXE `cat $RES`';
+{$else ndef cpu64bitaddr}
              ExeCmd[1]:='ld $PRTOBJ $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -no_dead_strip_inits_and_terms -multiply_defined suppress -L. -o $EXE `cat $RES`';
+{$endif ndef cpu64bitaddr}
              if (apptype<>app_bundle) then
                DllCmd[1]:='libtool $PRTOBJ $OPT -no_dead_strip_inits_and_terms -dynamic -multiply_defined suppress -L. -o $EXE `cat $RES`'
              else