Summary: | usage of initial-exec prevents dlopen of the libwebkit shared object outside of GLIBC on linux | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | alice | ||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bugs-noreply, mcatanzaro | ||||
Priority: | P2 | ||||||
Version: | Other | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=240392 | ||||||
Attachments: |
|
the patch of course has a typo in it- it's #endif not #fi Closing since TLS_MODEL_INITIAL_EXEC is no longer used anywhere in WebKit. The entire file that you patched was deleted at some point between then and now. looks to have been https://github.com/WebKit/WebKit/commit/b30a03a4c8a229deacb72a6e4fa46f6469df634f, seems fine to me. thanks for following up :) |
Created attachment 465547 [details] a fix for this issue usage of initial-exec prevents valid dlopen of the library later. this works on glibc, because glibc reserves some memory for initial-exec variables in dlopen'd objects. on other libcs, this doesn't work. for instance: $ cat main.c #include <dlfcn.h> #include <stdio.h> int main() { void *h = dlopen("libwebkit2gtk-4.0.so.37", 0); if(!h) { fprintf(stderr, "%s\n", dlerror()); return 1; } return 0; } $ gcc main.c $ ./a.out Error relocating /usr/lib/libwebkit2gtk-4.0.so.37: lroundf: initial-exec TLS resolves to dynamic definition in /usr/lib/libwebkit2gtk-4.0.so.37 $ ldd --version musl libc (x86_64) Version 1.2.3 Dynamic Program Loader Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname utilising initial-exec only when __GLIBC__ is defined fixes this.