You might want to investigate -ffunction-sections -fdata-sections and the
linker --gc-sections switches..
Dave.
On Mon, 13 Sep 2004, Bryan O'Donoghue wrote:
> Rory Browne wrote:
>> What I was hoping for was a mythical linker options a-la Mr Foster, which
> would remove non-referenced, or non-internally referenced functions, when
> linking directly to libblah.a "gcc -o blah /usr/lib/libblah.a"
>> > Personally if I was using SQLite I'd use it as a dynamic library.
>> That would be optimal, but at the same time, a single file, requires much less
> intervention by someone installing, especially if they are not so familiar
> with Linux... or at least... in theory
> > Unless you really need your binaries/deps to be as small as
> > possible(perhaps for embedded work)
>> I think there is a vague to outside chance that the resulting binary _might_
> get recompiled/retargetted for use on some sort of low end motorola CPU, used
> under cygwin or just banged out in a production version under WhiteBox/Suse
>> > > there is no(?) link-time advantage to putting functions
> > > into individual files for a shared library, which is,
> > > IMHO, why this seems to be a dying art/skill/science?
>> To be honest, I've never heard of putting each function into a seperate file,
> I'd say there's more then a few nails in that particular coffin !
>>
--
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!