Reproducable only on x86 hardened with PIE enabled and at least -O2.
Created attachment 237007 [details] minimal testcase
The only change we have done it in the TLS code so it behave as the gcc 3.4.6 did else you may get soemthing like this /usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/libuuid.a(gen_uuid.o): relocation R_X86_64_TPOFF32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC ../../lib/libuuid.a: could not read symbols: Bad value see more in http://bugs.gentoo.org/show_bug.cgi?id=232601 http://gcc.gnu.org/ml/gcc-patches/2005-03/msg00923.html The code change @@ -5607,7 +5607,11 @@ bool is_local; is_local = targetm.binds_local_p (decl); - if (!flag_shlib) + #ifdef ENABLE_ESP + if (!flag_pic) + #else + if (!flag_shlib) + #endif { if (is_local) kind = TLS_MODEL_LOCAL_EXEC;