On MIPS, several relocations that were original only resolved by the dynamic linker were reused as static relocations. Consequently the macros TLS_DTPREL_VALUE and TLS_TPREL_VALUE defined in libpthread/nptl/sysdeps/mips/dl-tls.h need to be available even for !SHARED.
Relevant: http://www.linux-mips.org/wiki/NPTL#History Original patch by Vincent Wen <[email protected]>: http://lists.uclibc.org/pipermail/uclibc/2013-April/047707.html When build statically linked applications for MIPS platform, sometimes the linker fails with following errors: undefined reference to TLS_DTPREL_VALUE undefined reference to TLS_TPREL_VALUE The include of dl-tls.h is only in code guarded by SHARED, Removing the SHARED compilation option to cover static link too. Signed-off-by: Vincent Wen <[email protected]> Signed-off-by: Gregory Fong <[email protected]> --- As far as I can tell, this is TLS_DTPREL_VALUE and TLS_TPREL_VALUE being needed for !SHARED is a MIPS-specific issue. I don't think this should break things on other platforms but testing and comments are very welcome. ldso/libdl/libdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 3a78696..ed4e735 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -42,6 +42,7 @@ #if defined(USE_TLS) && USE_TLS #include <ldsodefs.h> +#include <dl-tls.h> extern void _dl_add_to_slotinfo(struct link_map *l); #endif @@ -51,7 +52,6 @@ __UCLIBC_MUTEX_STATIC(_dl_mutex, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); #ifdef SHARED # if defined(USE_TLS) && USE_TLS -# include <dl-tls.h> extern struct link_map *_dl_update_slotinfo(unsigned long int req_modid); # endif -- 1.7.9.5 _______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
