DragonFlyBSD/src 50caca1lib/libc/gen dlfcn.c Symbol.map, lib/libthread_xu/thread thr_private.h thr_kern.c

rtld-elf - Notify thread state to optimize relocations

* Add shims to allow libthread_xu to notify rtld when threading
  is being used.

* Requires weak symbols in libc which are overriden by rtld-elf.

* Implement the feature in rtld-elf and use it to avoid making calls
  to lwp_gettid().  When threaded, use tls_get_tcb() (which does not
  require a system call) instead of lwp_gettid().  When not threaded,
  just use a constant.

  NOTE: We cannot use tls_get_tcb() unconditionally because the tcb
        is not setup during early relocations.  So do this whack-a-mole
        to make it work.

* This leaves just the sigprocmask wrappers around rtld-elf (which
  are needed to prevent stacked relocations from signal handlers).

Poked-by: mjg
DeltaFile
+53-18libexec/rtld-elf/rtld_lock.c
+8-0lib/libc/gen/dlfcn.c
+1-0lib/libc/gen/Symbol.map
+1-0libexec/rtld-elf/Symbol.map
+1-0libexec/rtld-elf/rtld.c
+1-0lib/libthread_xu/thread/thr_private.h
+1-0lib/libthread_xu/thread/thr_kern.c
+66-187 files

UnifiedSplitRaw