diff --git a/lib/libkse/Makefile b/lib/libkse/Makefile index ba86f080478..c0f0399f372 100644 --- a/lib/libkse/Makefile +++ b/lib/libkse/Makefile @@ -19,6 +19,7 @@ CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf +CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} CFLAGS+=-fno-builtin # Uncomment this if you want libpthread to contain debug information for diff --git a/lib/libkse/arch/amd64/include/pthread_md.h b/lib/libkse/arch/amd64/include/pthread_md.h index 86af4af39a4..4f903c57fd2 100644 --- a/lib/libkse/arch/amd64/include/pthread_md.h +++ b/lib/libkse/arch/amd64/include/pthread_md.h @@ -32,12 +32,14 @@ #ifndef _PTHREAD_MD_H_ #define _PTHREAD_MD_H_ +#include #include #include #include #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) #define THR_GETCONTEXT(ucp) \ (void)_amd64_save_context(&(ucp)->uc_mcontext) diff --git a/lib/libkse/arch/arm/include/pthread_md.h b/lib/libkse/arch/arm/include/pthread_md.h index 2ba486cae3c..e9d2b6f593e 100644 --- a/lib/libkse/arch/arm/include/pthread_md.h +++ b/lib/libkse/arch/arm/include/pthread_md.h @@ -38,6 +38,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *); int _thr_getcontext(mcontext_t *); diff --git a/lib/libkse/arch/i386/include/pthread_md.h b/lib/libkse/arch/i386/include/pthread_md.h index 2d4b0e00245..d208d2ecb68 100644 --- a/lib/libkse/arch/i386/include/pthread_md.h +++ b/lib/libkse/arch/i386/include/pthread_md.h @@ -31,6 +31,7 @@ #ifndef _PTHREAD_MD_H_ #define _PTHREAD_MD_H_ +#include #include #include @@ -38,6 +39,7 @@ extern int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *); extern int _thr_getcontext(mcontext_t *); #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) #define THR_GETCONTEXT(ucp) _thr_getcontext(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) _thr_setcontext(&(ucp)->uc_mcontext, 0, NULL) diff --git a/lib/libkse/arch/ia64/include/pthread_md.h b/lib/libkse/arch/ia64/include/pthread_md.h index 264909cd586..220077a4195 100644 --- a/lib/libkse/arch/ia64/include/pthread_md.h +++ b/lib/libkse/arch/ia64/include/pthread_md.h @@ -34,6 +34,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) #define THR_GETCONTEXT(ucp) _ia64_save_context(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) PANIC("THR_SETCONTEXT() now in use!\n") diff --git a/lib/libkse/arch/powerpc/include/pthread_md.h b/lib/libkse/arch/powerpc/include/pthread_md.h index 776d45b3c86..5d00ab36ba2 100644 --- a/lib/libkse/arch/powerpc/include/pthread_md.h +++ b/lib/libkse/arch/powerpc/include/pthread_md.h @@ -42,6 +42,7 @@ extern int _ppc32_setcontext(mcontext_t *, intptr_t, intptr_t *); extern int _ppc32_getcontext(mcontext_t *); #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb.tcb_tp.tp_dtv) #define THR_GETCONTEXT(ucp) _ppc32_getcontext(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) _ppc32_setcontext(&(ucp)->uc_mcontext, 0, NULL) diff --git a/lib/libkse/arch/sparc64/include/pthread_md.h b/lib/libkse/arch/sparc64/include/pthread_md.h index 4700d73b254..1abbe653ff3 100644 --- a/lib/libkse/arch/sparc64/include/pthread_md.h +++ b/lib/libkse/arch/sparc64/include/pthread_md.h @@ -38,6 +38,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *); int _thr_getcontext(mcontext_t *); diff --git a/lib/libkse/thread/Makefile.inc b/lib/libkse/thread/Makefile.inc index fb11adb6180..59fa21c4dcf 100644 --- a/lib/libkse/thread/Makefile.inc +++ b/lib/libkse/thread/Makefile.inc @@ -103,6 +103,7 @@ SRCS+= \ thr_suspend_np.c \ thr_switch_np.c \ thr_system.c \ + thr_symbols.c \ thr_tcdrain.c \ thr_vfork.c \ thr_wait.c \ diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index ba86f080478..c0f0399f372 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -19,6 +19,7 @@ CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf +CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} CFLAGS+=-fno-builtin # Uncomment this if you want libpthread to contain debug information for diff --git a/lib/libpthread/arch/alpha/include/pthread_md.h b/lib/libpthread/arch/alpha/include/pthread_md.h index 5266a6de021..908bcfd6a12 100644 --- a/lib/libpthread/arch/alpha/include/pthread_md.h +++ b/lib/libpthread/arch/alpha/include/pthread_md.h @@ -34,6 +34,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) #define THR_GETCONTEXT(ucp) _alpha_save_context(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) PANIC("THR_SETCONTEXT() now in use!\n") diff --git a/lib/libpthread/arch/amd64/include/pthread_md.h b/lib/libpthread/arch/amd64/include/pthread_md.h index 86af4af39a4..4f903c57fd2 100644 --- a/lib/libpthread/arch/amd64/include/pthread_md.h +++ b/lib/libpthread/arch/amd64/include/pthread_md.h @@ -32,12 +32,14 @@ #ifndef _PTHREAD_MD_H_ #define _PTHREAD_MD_H_ +#include #include #include #include #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) #define THR_GETCONTEXT(ucp) \ (void)_amd64_save_context(&(ucp)->uc_mcontext) diff --git a/lib/libpthread/arch/arm/include/pthread_md.h b/lib/libpthread/arch/arm/include/pthread_md.h index 2ba486cae3c..e9d2b6f593e 100644 --- a/lib/libpthread/arch/arm/include/pthread_md.h +++ b/lib/libpthread/arch/arm/include/pthread_md.h @@ -38,6 +38,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *); int _thr_getcontext(mcontext_t *); diff --git a/lib/libpthread/arch/i386/include/pthread_md.h b/lib/libpthread/arch/i386/include/pthread_md.h index 2d4b0e00245..d208d2ecb68 100644 --- a/lib/libpthread/arch/i386/include/pthread_md.h +++ b/lib/libpthread/arch/i386/include/pthread_md.h @@ -31,6 +31,7 @@ #ifndef _PTHREAD_MD_H_ #define _PTHREAD_MD_H_ +#include #include #include @@ -38,6 +39,7 @@ extern int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *); extern int _thr_getcontext(mcontext_t *); #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) #define THR_GETCONTEXT(ucp) _thr_getcontext(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) _thr_setcontext(&(ucp)->uc_mcontext, 0, NULL) diff --git a/lib/libpthread/arch/ia64/include/pthread_md.h b/lib/libpthread/arch/ia64/include/pthread_md.h index 264909cd586..220077a4195 100644 --- a/lib/libpthread/arch/ia64/include/pthread_md.h +++ b/lib/libpthread/arch/ia64/include/pthread_md.h @@ -34,6 +34,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) #define THR_GETCONTEXT(ucp) _ia64_save_context(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) PANIC("THR_SETCONTEXT() now in use!\n") diff --git a/lib/libpthread/arch/powerpc/include/pthread_md.h b/lib/libpthread/arch/powerpc/include/pthread_md.h index 776d45b3c86..5d00ab36ba2 100644 --- a/lib/libpthread/arch/powerpc/include/pthread_md.h +++ b/lib/libpthread/arch/powerpc/include/pthread_md.h @@ -42,6 +42,7 @@ extern int _ppc32_setcontext(mcontext_t *, intptr_t, intptr_t *); extern int _ppc32_getcontext(mcontext_t *); #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb.tcb_tp.tp_dtv) #define THR_GETCONTEXT(ucp) _ppc32_getcontext(&(ucp)->uc_mcontext) #define THR_SETCONTEXT(ucp) _ppc32_setcontext(&(ucp)->uc_mcontext, 0, NULL) diff --git a/lib/libpthread/arch/sparc64/include/pthread_md.h b/lib/libpthread/arch/sparc64/include/pthread_md.h index 4700d73b254..1abbe653ff3 100644 --- a/lib/libpthread/arch/sparc64/include/pthread_md.h +++ b/lib/libpthread/arch/sparc64/include/pthread_md.h @@ -38,6 +38,7 @@ #include #define KSE_STACKSIZE 16384 +#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_dtv) int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *); int _thr_getcontext(mcontext_t *); diff --git a/lib/libpthread/pthread.map b/lib/libpthread/pthread.map index 133f6945c7a..bb04272e239 100644 --- a/lib/libpthread/pthread.map +++ b/lib/libpthread/pthread.map @@ -331,10 +331,26 @@ global: # Debugger needs these. _libkse_debug; _thread_activated; - _thread_list; - _thread_keytable; _thread_active_threads; - + _thread_keytable; + _thread_list; + _thread_max_keys; + _thread_off_attr_flags; + _thread_off_dtv; + _thread_off_linkmap; + _thread_off_next; + _thread_off_tcb; + _thread_off_tmbx; + _thread_off_key_allocated; + _thread_off_key_destructor; + _thread_off_kse; + _thread_off_kse_locklevel; + _thread_off_state; + _thread_off_thr_locklevel; + _thread_off_tlsindex; + _thread_size_key; + _thread_state_running; + _thread_state_zoombie; local: *; }; diff --git a/lib/libpthread/thread/Makefile.inc b/lib/libpthread/thread/Makefile.inc index fb11adb6180..59fa21c4dcf 100644 --- a/lib/libpthread/thread/Makefile.inc +++ b/lib/libpthread/thread/Makefile.inc @@ -103,6 +103,7 @@ SRCS+= \ thr_suspend_np.c \ thr_switch_np.c \ thr_system.c \ + thr_symbols.c \ thr_tcdrain.c \ thr_vfork.c \ thr_wait.c \