Next: Setting Heap Size from gnatlink, Previous: Debugging a DLL, Up: Microsoft Windows Topics
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 Linker_Options or with gnatbind -d. On older versions of Windows (2000, NT4, etc.), it is not possible to set the reserve size of individual tasks and thus the link-time stack size applies to all tasks.
This setting can be done with gnatlink using either:
$ gnatlink hello -Xlinker --stack=0x10000,0x1000
This sets the stack reserve size to 0x10000 bytes and the stack commit size to 0x1000 bytes.
$ 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 coma is a separator for this option.