[gnutls-devel] GnuTLS | build: change Nettle library link order to support static linking (!1862)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed Aug 14 10:52:30 CEST 2024




Alexander Sosedkin commented: https://gitlab.com/gnutls/gnutls/-/merge_requests/1862#note_2045691449


The change confuses me.

I know that linking order matters, but this change goes against my understanding of how it works. I thought that the linker does a left-to-right pass maintaining a list of used-but-not-unresolved symbols and bails out at the end if there are any of them left; so it first needs to know learn there's a demand for a symbol, then resolve it, not the other way around.

Can't back that with a decent quote though, the best I've found in 5 minutes is this excerpt from [GCC docs](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-for-linking.html):

> the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1862#note_2045691449
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20240814/f4d2e035/attachment-0001.html>


More information about the Gnutls-devel mailing list