Skip to content
Snippets Groups Projects
Commit 781802da authored by Simon McVittie's avatar Simon McVittie
Browse files

mkstublib: Explain why it is not OK for _capsule_init to use capsule_meta

parent 62c38f41
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -390,8 +390,13 @@ static void __attribute__ ((constructor)) _capsule_init (void) ...@@ -390,8 +390,13 @@ static void __attribute__ ((constructor)) _capsule_init (void)
{ NULL } { NULL }
}; };
// Don't use capsule_meta.soname here - use a static value. // Don't use capsule_meta.soname here, because if we did, it would be
// Trust me when I say you don't want to know why. // a relocatable, interposable reference to capsule_meta (assuming the
// shim library wasn't linked with -Bsymbolic). At runtime, we'd get
// an arbitrarily chosen one of the capsule_meta symbols defined by
// the other shim libraries sharing our global symbol namespace,
// and in particular not necessarily our own, with predictably bad
// results.
cap = capsule_init( soname ); cap = capsule_init( soname );
dso = capsule_load( cap, wrappers, &capsule_errno, &capsule_error ); dso = capsule_load( cap, wrappers, &capsule_errno, &capsule_error );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment