LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Statically linking only used functions

[ILUG] Statically linking only used functions

Rory Browne rory.browne at gmail.com
Sat Sep 11 14:54:00 IST 2004


One advantage would be a smaller binary. I tested this, and the binary with
not_used() linked in, was slightly smaller than the binary with
not_used() linked in.

I assume that the difference would be more significant if the not_used()
function was bigger, than the printf("this function is not used");
that it was in my code.

I would also assume that you would get a slight(albeit very slight)
speed increase, from not compiling in stuff that you don't need.

Personally if I was using SQLite I'd use it as a dynamic library.
Unless you really need your binaries/deps to be as small as
possible(perhaps for embedded work), I'd just link in the whole thing,
but I'd do it dynamicly. What do you need this for? If it's for use on
an ordinary computer or a server

 > 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?



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell