Thanks, and yes your right its more about the 2nd issue than first tho I want to run this on a particular small embedded board with limited RAM. The limit for the RAM is still a lot more than the app tho so its no real biggie.

I saw that stack overflow post which is what prompted me to try the hidden visibility. This visibility thing is more to do with whether functions in a shared library are visible to link to. In windows you need to declare them visible with an 'export'. It seems in gcc that its by default mostly visible and you need to hide the ones you don't want people to be able to link to. But all of that is aside because its for making a shared lib but mine is an app which is self contained except for the shared libs it uses. A compiler (well linker) should attach all of the required loose ends together and then remove all those unused bits and then clean up the link info in the binary but gcc seems to be leaving a lot of cruft still in the binary. Personally I don't think there is a solution to this but maybe I am wrong. People who release non open source stuff for linux must have come across this but they might be using a different compiler and linker.