I know that there is an option \"-Os\" to \"Optimize for size\", but it has little affect, or even increase the size on some occasion :(
strip (or \"-s\" option) remov
When using strip(1), you'll want to make sure you use all the relevant options. For some reason, --strip-all
doesn't always strip everything. Removing unnecessary sections may be helpful.
Ultimately, though, the best way to reduce the size of the binary is to remove code and static data from the program. Make it do less, or select programming constructs that result in fewer instructions. For example, you might build data structures at runtime, or load them from a file, on-demand, rather than have a statically initialized array.