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 ? > from object > files, and it can remove uncalled global functions if you're > using global optimization. Do you mean "-xipo" ? > The strip command can be used > to remove debug information without damaging the dynamic symbol > table. It's also a good idea (for several reasons) to create a > basic linker mapfile for your shared libraries so that you can > explicitly declare which symbols you intend to export. > > Of course, this leads to the question: Why not just remove > all your unused code and symbols from the source code? > That's bound to be a more portable and robust approach to > your problem. > > Probably there are specific symbols or code you have in mind > to remove, but you didn't say what those are. 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). ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;)
