Roland: > Erm... the problem is a bit... erm... messy and revolves around ksh93 > and libast. libast has code which isn't (currently) used by ksh93, a > couple of legacy symbols, may be gradually phased out in the upstream > codebase and which are not in our OS/Net mapfile, however I would prefer > not poking in the Makefile or sources to "manually" disable the code > since we may sooner (or later) get a few more consumers of libast which > then may need the legacy interfaces - or not. > Therefore I'm looking for a quick&dirty way to strip unused symbols > (mainly global r/w variables which show-up in the footprint) "on demand" > but keeping a way to enable them quickly if the need arises (disclaimer: > Yes, this is a quick&&dirty hack... we're getting rid of the legacy > interfaces soon but the consumer codebase of libast is very large > (larger than OS/Net itself) and it needs some time to convert all > applications).
You these routines are not in the OS/Net mapfile (assuming a conventional mapfile), then they won't be callable from the resulting shared library. At that point you're not losing anything by adding an "#ifdef EXTRAS" into the source code. I can't think anything that qualifies as a "Quick hack" that would be reliable enough and easy enough to get working, for me to recommend. Roland Mainz wrote: > Chris Quenelle wrote: >> Roland Mainz wrote: >>> Does Sun Workshop/Forte/Studio have an option to strip all unused >>> code/symbols from a shared library ? >> There's not a "point and shoot" kind of feature that removes "unused stuff" >> from your program. >> >> The optimizer can remove uncalled static functions > > What about unused r/w data variables ? I think it can do global data as well. I'm not sure. > >> from object >> files, and it can remove uncalled global functions if you're >> using global optimization. > > Do you mean "-xipo" ? Yes -xipo.
