gnatlink
¶It is possible to specify the program stack size at link time. On modern versions of Windows, starting with XP, this is mostly useful to set the size of the main stack (environment task). The other task stacks are set with pragma Storage_Size or with the `gnatbind -d' command.
Since older versions of Windows (2000, NT4, etc.) do not allow setting the reserve size of individual tasks, the link-time stack size applies to all tasks, and pragma Storage_Size has no effect. In particular, Stack Overflow checks are made against this link-time specified size.
This setting can be done with gnatlink
using either of the following:
-Xlinker
linker option
$ gnatlink hello -Xlinker --stack=0x10000,0x1000
This sets the stack reserve size to 0x10000 bytes and the stack commit size to 0x1000 bytes.
-Wl
linker option
$ gnatlink hello -Wl,--stack=0x1000000
This sets the stack reserve size to 0x1000000 bytes. Note that with
-Wl
option it is not possible to set the stack commit size
because the comma is a separator for this option.