Skip to content
Snippets Groups Projects
Commit 350f4f61 authored by vdukhovni's avatar vdukhovni Committed by Marge Bot
Browse files

Support R_X86_64_TLSGD relocation on FreeBSD

The FreeBSD C <ctype.h> header supports per-thread locales by exporting a
static inline function that references the `_ThreadRuneLocale` thread-local
variable.  This means that object files that use e.g. isdigit(3) end up with
TLSGD(19) relocations, and would not load into ghci or the language server.

Here we add support for this type of relocation, for now just on FreeBSD, and
only for external references to thread-specifics defined in already loaded
dynamic modules (primarily libc.so).  This is sufficient to resolve the
<ctype.h> issues.

Runtime linking of ".o" files which *define* new thread-specific variables
would be noticeably more difficult, as this would likely require new rtld APIs.
parent 4723652a
No related branches found
No related tags found
Loading
Loading
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