I wrote a small driver program utilizing static version of GNU gmp
library. I observed that the library itself is 1.2 MB
while the driver executable is of 237 KB
. This has led me to believe that the linker ld
is smart enough to include only the required code from the library, thus eliminating the unnecessary instructions to prevent the executable from being bulky.
Is there any means to instruct ld
to link the entire gmp
library (even the unnecessary code) starting at some specified location?