Display or modify the contents of an ELF note (QNX)
elfnote [-pv] [-n name] [-t type] [-m value [-F fmt]] [-S num [-L]] file [outfile]
QNX Neutrino, Linux, Mac, Microsoft Windows
You typically use elfnote to modify QNT_STACK, as described below.
The elfnote utility displays or modifies the contents of a note in an Executable and Linkable Format file.
When you're modifying the contents of a note, you must specify both -t and -n. The value passed to -m is a hexadecimal representation of raw data. Therefore, if the note description contains (for example) numeric types, you must convert them to target endian order and represent them in hexadecimal format.
Set stacksize to 128 KB, and allocate it at thread creation time:
elfnote -S 128k file
Specify a stack size of 128 KB, lazy allocated:
elfnote -S 128k -L file
Assume you have a binary containing a note with a name SP_NOTE and type 9, consisting of the four 32-bit values, 100, 200, 300 and 400. Display the note:
elfnote -p -n SP_NOTE file Note name = SP_NOTE, type = 9 hex : 64000000c80000002c01000090010000
Change the values to 16, 32, 48 and 64:
elfnote -n SP_NOTE -t 9 -F n -m 16,32,48,64 file
Display the changed note:
elfnote -p -n SP_NOTE file Note name = SP_NOTE, type = 9 hex : 10000000200000003000000040000000
Change the value back to the original by specifying a hex string:
elfnote -n SP_NOTE -t 9 -m 64000000c80000002c01000090010000 file
Display the result again:
elfnote -p -n SP_NOTE file Note name = SP_NOTE, type = 9 hex : 64000000c80000002c01000090010000