New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linking order #2566
Comments
Setting the |
I am confused. Are you saying that we should say to every user of virtually any software that links directly with jemalloc to set That doesn't exactly sound scalable to me, so I want to double check that this is what you meant. |
Sorry for the confusion, I think I misunderstood the question: I thought we were discussing as the users of the binaries. To solve the problem by setting compilation flags, is the flag |
Yes, it is. It's actually dynamic linker that is causing the problem - since we don't use any jemalloc symbols directly, but only via the external library, jemalloc gets loaded too late (after glibc). |
This is actually interesting problem - when jemalloc is linked to a binary, but it is not used directly, but via library, the runtime linker might pull the jemalloc too late and libc would be already loaded. This could create a mess later.
Adding something that references any symbol from jemalloc into
main()
helps linker with the correct order, but adding a line into every binary doesn't really scale, right?A more detailed example can be seen here: https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/8478#note_415474
I've tried all possible combinations of
-z initfirst
and-z now
on the shared library and couple of extra ideas, but none helped, I always end up with:before
The text was updated successfully, but these errors were encountered: