Setting the Stack Size for a User-Space Application Print

 

This application note explains how to set up the stack size for a user-space application.

The stack size can be changed using the arm-uclinuxeabi-flthdr utility:

[psl@ocean app]$ arm-uclinuxeabi-flthdr -?
arm-uclinuxeabi-flthdr: invalid option -- '?'
invalid option
usage: arm-uclinuxeabi-flthdr [options] flat-file
Allows you to change an existing flat file

-p : print current settings
-z : compressed flat file
-d : compressed data-only flat file
-Z : un-compressed flat file
-r : ram load
-R : do not RAM load
-k : kernel traced load (for debug)
-K : normal non-kernel traced load
-s size : stack size
-o file : output-file
(default is to modify input file)
Report bugs to <URL:https://support.codesourcery.com/GNUToolchain/>
[psl@ocean app]$ arm-uclinuxeabi-flthdr app
app
Magic: bFLT
Rev: 4
Build Date: Fri Nov 23 13:24:57 2012
Entry: 0x45
Data Start: 0x4300
Data End: 0x5440
BSS End: 0x7500
Stack Size: 0x1000
Reloc Start: 0x5440
Reloc Count: 0x7d
Flags: 0x1 ( Load-to-Ram )
[psl@ocean app]$ arm-uclinuxeabi-flthdr -s 8192 app
[psl@ocean app]$ arm-uclinuxeabi-flthdr app
app
Magic: bFLT
Rev: 4
Build Date: Fri Nov 23 13:24:57 2012
Entry: 0x45
Data Start: 0x4300
Data End: 0x5440
BSS End: 0x7500
Stack Size: 0x2000
Reloc Start: 0x5440
Reloc Count: 0x7d
Flags: 0x1 ( Load-to-Ram )
[psl@ocean app]$