This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Another way to salvage Annex K and its constraint handler
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: Martin Sebor <msebor at redhat dot com>
- Date: Fri, 20 Nov 2015 16:17:22 +0100
- Subject: Another way to salvage Annex K and its constraint handler
- Authentication-results: sourceware.org; auth=none
While looking at __dso_handle and implementing a no-fail wrapper for
getrandom, it occurred to me that we can implement Annex K in a useful
fashion, with the constraint handler:
We put the variable that holds the constraint handler address into
libc_nonshared.a (maybe even as a weak symbol), and pass the address of
the variable to the actual Annex K implementation functions (with the
help of inline wrappers, probably). This way, each DSO can install the
constraint handler it wants. This would remove the need for a
per-thread constraint handler (which would require constant switching of
the handler at library boundaries) because libraries know when they
change constraint handlers and implement suitable locking.
DSOs are out of the scope of C standard, so no standards action is
needed here.
Thoughts?
Florian