glibc/elf/tst-audit9.c
Carlos O'Donell d050367659 BZ #16613: Support TLS in audit libraries.
This commit fixes a bug where the dynamic loader would crash
when loading audit libraries, via LD_AUDIT, where those libraries
used TLS. The dynamic loader was not considering that the audit
libraries would use TLS and failed to bump the TLS generation
counter leaving TLS usage inconsistent after loading the audit
libraries.

https://sourceware.org/ml/libc-alpha/2014-02/msg00569.html
2014-02-25 13:18:15 -05:00

9 lines
153 B
C

#include <dlfcn.h>
int main(void)
{
void *h = dlopen("$ORIGIN/tst-auditmod9b.so", RTLD_LAZY);
int (*fp)(void) = dlsym(h, "f");
return fp() - 1;
}