This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77285] [5/6/7 Regression] extern thread_local linkage
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Aug 2016 10:30:19 +0000
- Subject: [Bug c++/77285] [5/6/7 Regression] extern thread_local linkage
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-77285-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77285
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:
cat >a.cpp <<EOF
struct __attribute__((abi_tag("tag"))) X { ~X() { }int i = 0; };
thread_local X gFeelingLucky;
EOF
cat >main.cpp <<EOF
struct __attribute__((abi_tag("tag"))) X { ~X() { }int i = 0; };
extern thread_local X gFeelingLucky;
int main() {
return gFeelingLucky.i;
}
EOF
g++ main.cpp a.cpp
/tmp/ccTyHWNr.o: In function `TLS wrapper function for gFeelingLucky':
main.cpp:(.text._ZTW13gFeelingLucky[_ZTW13gFeelingLucky]+0x5): undefined
reference to `TLS init function for gFeelingLucky'
collect2: error: ld returned 1 exit status
nm a.o
U _GLOBAL_OFFSET_TABLE_
0000000000000000 B _Z13gFeelingLuckyB5cxx11
U _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev
U _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
0000000000000000 r _ZStL19piecewise_construct
0000000000000000 T _ZTH13gFeelingLuckyB5cxx11
U __cxa_thread_atexit
U __dso_handle
0000000000000020 b __tls_guard
0000000000000000 t __tls_init
nm main.o
U _GLOBAL_OFFSET_TABLE_
U _Z13gFeelingLuckyB5cxx11
U
_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv
0000000000000000 r _ZStL19piecewise_construct
U _ZTH13gFeelingLucky
0000000000000000 W _ZTW13gFeelingLucky
0000000000000000 T main