From ec8364904cd3b8ec43ecca1e7f5c972ba152caad Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 26 Aug 2009 21:18:53 +0000 Subject: [PATCH] * 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 - --- compiler/systems/t_bsd.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas index de8118b29e..c04d61a1d0 100644 --- a/compiler/systems/t_bsd.pas +++ b/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