-
Static library linkage
To get rid from dynamic shared linkage i should rather link library as object file i.e.
gcc <my_objects> /full/path/to/my_lib.a
. And i wonder whether in this case some unneeded object files are really discarded as they use to be under linkage via "-l" flag. I suspect it's not case because of too large output binary.
-
Static linkage will always give you a bigger object file than dynamic linkage.
If the library is well constructed (lots of individual modules), then you should only get what you need.
You could try things like
$ size a.out
text data bss dec hex filename
1542 520 16 2078 81e a.out
$ ls -l a.out
-rwxrwxr-x 1 sc sc 8480 2013-01-07 16:52 a.out
$ strip a.out
$ ls -l a.out
-rwxrwxr-x 1 sc sc 6216 2013-01-08 18:53 a.out
But bear in mind that a stripped executable is nigh on impossible to debug.