https://sourceware.org/bugzilla/show_bug.cgi?id=20805
--- Comment #5 from Cary Coutant <ccoutant at gmail dot com> --- > Gold does not optimize any TLS references when building a shared library. > > In this case, where cur_thread_placeholder has hidden visibility, I think we > should be able to optimize it down to IE, as ld.bfd does. I take that back. We can't convert the GD model to IE unless we know that the shared library we're building will never be dlopen'ed, and there's no current way to tell the linker that. If you want the IE model, it needs to be compiled that way. Apparently, you were actually trying to do that, but the attribute didn't have the desired effect (perhaps because the inliner didn't propagate the tls model to the outer function), and you lucked out because ld.bfd went ahead and made the optimization anyway. I'm not sure why it did that, but I don't think it should have. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils