OpenSSL Static Library too big, any alternative or way to reduce its size?
I think you want this page, particular the section on code size:
https://en.wikipedia.org/w/index.php?title=Comparison_of_TLS_implementations&oldid=585386367#Code_size_and_dependencies
(dated December 2013)
update: Alas no longer a part of the updated page.
You can try compiling it yourself with --ffunction-sections
and --fdata-sections
, which tells gcc to put each function and global data variable in a separate section inside the object.
(When using static libraries, the linker copies the entire object which contains the needed function from the archive to the application.)
OpenSSL does have a large number of compile-time options to control what features are built. I believe that the SSL functions use BIO
s underneath, so you'll still need those, but there's a lot of other functionality you can probably go without (like ciphers you won't use, envelope encryption, S/MIME support...).
I'm not sure how much it will reduce the binary size by, but it's worth a try.