Преглед изворни кода

Set STACK_MARGIN_MAX to four times of pagesize on LoongArch64

It fixed a test named tstack. Actually, Linux user get the stacktop is
incorrect in current. The value of stack pointer when enter the procedure
is thought as it is in the highest stack page. But if the parameters is
enough large, lager than 16k, most of arch will also fail this test.
Since the LoongArch default pagesize is 16k, it fail often because
stack-layout-randomization causes the stackpointer underflow to next page.
I had tried fixed it in rtl/linux/[arch]/si_*. But because the codes is
unworthy and hardly the parameters is enough large, just expand
STACK_MARGIN_MAX for simplicity.
Jinyang He пре 2 година
родитељ
комит
6ef31c643a
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      rtl/inc/system.inc

+ 2 - 0
rtl/inc/system.inc

@@ -48,6 +48,8 @@ const
   STACK_MARGIN_MAX = 64;    { Stack size margin for stack checking }
 {$elseif defined(CPUZ80)}
   STACK_MARGIN_MAX = 64;    { Stack size margin for stack checking }
+{$elseif defined(CPULOONGARCH64)}
+  STACK_MARGIN_MAX = 65536;    { Stack size margin for stack checking }
 {$else}
   STACK_MARGIN_MAX = 16384;    { Stack size margin for stack checking }
 {$endif}