GAS LISTING /tmp/ccVfdYKF.s page 1 1 .file "thread-local.cpp" 2 .text 3 .Ltext0: 5 _Z41__static_initialization_and_destruction_0ii: 6 .LFB1402: 7 .file 1 "thread-local.cpp" 1:thread-local.cpp **** #include <iostream> 2:thread-local.cpp **** 3:thread-local.cpp **** thread_local std::string threadName("starting name"); 4:thread-local.cpp **** 5:thread-local.cpp **** void threadLocal() { 6:thread-local.cpp **** threadName = "myname"; 7:thread-local.cpp **** 8:thread-local.cpp **** std::cout << "threadLocal name=" << threadName << std::endl; 9:thread-local.cpp **** } 8 .loc 1 9 0 9 .cfi_startproc 10 .LVL0: 11 0000 83FF01 cmpl $1, %edi 12 0003 752E jne .L5 13 .loc 1 9 0 discriminator 1 14 0005 81FEFFFF cmpl $65535, %esi 14 0000 15 000b 7526 jne .L5 16 .loc 1 9 0 is_stmt 0 17 000d 4883EC08 subq $8, %rsp 18 .cfi_def_cfa_offset 16 19 .file 2 "/usr/include/c++/4.8/iostream" 1:/usr/include/c++/4.8/iostream **** // Standard iostream objects -*- C++ -*- 2:/usr/include/c++/4.8/iostream **** 3:/usr/include/c++/4.8/iostream **** // Copyright (C) 1997-2013 Free Software Foundation, Inc. 4:/usr/include/c++/4.8/iostream **** // 5:/usr/include/c++/4.8/iostream **** // This file is part of the GNU ISO C++ Library. This library is free 6:/usr/include/c++/4.8/iostream **** // software; you can redistribute it and/or modify it under the 7:/usr/include/c++/4.8/iostream **** // terms of the GNU General Public License as published by the 8:/usr/include/c++/4.8/iostream **** // Free Software Foundation; either version 3, or (at your option) 9:/usr/include/c++/4.8/iostream **** // any later version. 10:/usr/include/c++/4.8/iostream **** 11:/usr/include/c++/4.8/iostream **** // This library is distributed in the hope that it will be useful, 12:/usr/include/c++/4.8/iostream **** // but WITHOUT ANY WARRANTY; without even the implied warranty of 13:/usr/include/c++/4.8/iostream **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14:/usr/include/c++/4.8/iostream **** // GNU General Public License for more details. 15:/usr/include/c++/4.8/iostream **** 16:/usr/include/c++/4.8/iostream **** // Under Section 7 of GPL version 3, you are granted additional 17:/usr/include/c++/4.8/iostream **** // permissions described in the GCC Runtime Library Exception, version 18:/usr/include/c++/4.8/iostream **** // 3.1, as published by the Free Software Foundation. 19:/usr/include/c++/4.8/iostream **** 20:/usr/include/c++/4.8/iostream **** // You should have received a copy of the GNU General Public License and 21:/usr/include/c++/4.8/iostream **** // a copy of the GCC Runtime Library Exception along with this program; 22:/usr/include/c++/4.8/iostream **** // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23:/usr/include/c++/4.8/iostream **** // <http://www.gnu.org/licenses/>. 24:/usr/include/c++/4.8/iostream **** 25:/usr/include/c++/4.8/iostream **** /** @file include/iostream 26:/usr/include/c++/4.8/iostream **** * This is a Standard C++ Library header. 27:/usr/include/c++/4.8/iostream **** */ 28:/usr/include/c++/4.8/iostream **** 29:/usr/include/c++/4.8/iostream **** // GAS LISTING /tmp/ccVfdYKF.s page 2 30:/usr/include/c++/4.8/iostream **** // ISO C++ 14882: 27.3 Standard iostream objects 31:/usr/include/c++/4.8/iostream **** // 32:/usr/include/c++/4.8/iostream **** 33:/usr/include/c++/4.8/iostream **** #ifndef _GLIBCXX_IOSTREAM 34:/usr/include/c++/4.8/iostream **** #define _GLIBCXX_IOSTREAM 1 35:/usr/include/c++/4.8/iostream **** 36:/usr/include/c++/4.8/iostream **** #pragma GCC system_header 37:/usr/include/c++/4.8/iostream **** 38:/usr/include/c++/4.8/iostream **** #include <bits/c++config.h> 39:/usr/include/c++/4.8/iostream **** #include <ostream> 40:/usr/include/c++/4.8/iostream **** #include <istream> 41:/usr/include/c++/4.8/iostream **** 42:/usr/include/c++/4.8/iostream **** namespace std _GLIBCXX_VISIBILITY(default) 43:/usr/include/c++/4.8/iostream **** { 44:/usr/include/c++/4.8/iostream **** _GLIBCXX_BEGIN_NAMESPACE_VERSION 45:/usr/include/c++/4.8/iostream **** 46:/usr/include/c++/4.8/iostream **** /** 47:/usr/include/c++/4.8/iostream **** * @name Standard Stream Objects 48:/usr/include/c++/4.8/iostream **** * 49:/usr/include/c++/4.8/iostream **** * The <iostream> header declares the eight <em>standard stream 50:/usr/include/c++/4.8/iostream **** * objects</em>. For other declarations, see 51:/usr/include/c++/4.8/iostream **** * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html 52:/usr/include/c++/4.8/iostream **** * and the @link iosfwd I/O forward declarations @endlink 53:/usr/include/c++/4.8/iostream **** * 54:/usr/include/c++/4.8/iostream **** * They are required by default to cooperate with the global C 55:/usr/include/c++/4.8/iostream **** * library's @c FILE streams, and to be available during program 56:/usr/include/c++/4.8/iostream **** * startup and termination. For more information, see the HOWTO 57:/usr/include/c++/4.8/iostream **** * linked to above. 58:/usr/include/c++/4.8/iostream **** */ 59:/usr/include/c++/4.8/iostream **** //@{ 60:/usr/include/c++/4.8/iostream **** extern istream cin; /// Linked to standard input 61:/usr/include/c++/4.8/iostream **** extern ostream cout; /// Linked to standard output 62:/usr/include/c++/4.8/iostream **** extern ostream cerr; /// Linked to standard error (unbuffered) 63:/usr/include/c++/4.8/iostream **** extern ostream clog; /// Linked to standard error (buffered) 64:/usr/include/c++/4.8/iostream **** 65:/usr/include/c++/4.8/iostream **** #ifdef _GLIBCXX_USE_WCHAR_T 66:/usr/include/c++/4.8/iostream **** extern wistream wcin; /// Linked to standard input 67:/usr/include/c++/4.8/iostream **** extern wostream wcout; /// Linked to standard output 68:/usr/include/c++/4.8/iostream **** extern wostream wcerr; /// Linked to standard error (unbuffered) 69:/usr/include/c++/4.8/iostream **** extern wostream wclog; /// Linked to standard error (buffered) 70:/usr/include/c++/4.8/iostream **** #endif 71:/usr/include/c++/4.8/iostream **** //@} 72:/usr/include/c++/4.8/iostream **** 73:/usr/include/c++/4.8/iostream **** // For construction of filebuffers for cout, cin, cerr, clog et. al. 74:/usr/include/c++/4.8/iostream **** static ios_base::Init __ioinit; 20 .loc 2 74 0 is_stmt 1 21 0011 BF000000 movl $_ZStL8__ioinit, %edi 21 00 22 .LVL1: 23 0016 E8000000 call _ZNSt8ios_base4InitC1Ev 23 00 24 .LVL2: 25 001b BA000000 movl $__dso_handle, %edx 25 00 26 0020 BE000000 movl $_ZStL8__ioinit, %esi 26 00 27 0025 BF000000 movl $_ZNSt8ios_base4InitD1Ev, %edi GAS LISTING /tmp/ccVfdYKF.s page 3 27 00 28 002a E8000000 call __cxa_atexit 28 00 29 .LVL3: 30 .loc 1 9 0 31 002f 4883C408 addq $8, %rsp 32 .cfi_def_cfa_offset 8 33 .L5: 34 0033 C3 ret 35 .cfi_endproc 36 .LFE1402: 38 .section .rodata.str1.1,"aMS",@progbits,1 39 .LC0: 40 0000 73746172 .string "starting name" 40 74696E67 40 206E616D 40 6500 41 .text 43 __tls_init: 44 .LFB1403: 45 .loc 1 9 0 46 .cfi_startproc 47 0034 64803C25 cmpb $0, %fs:__tls_guard@tpoff 47 00000000 47 00 48 003d 7547 jne .L10 49 .loc 1 9 0 discriminator 1 50 003f 53 pushq %rbx 51 .cfi_def_cfa_offset 16 52 .cfi_offset 3, -16 53 0040 4883EC10 subq $16, %rsp 54 .cfi_def_cfa_offset 32 55 0044 64C60425 movb $1, %fs:__tls_guard@tpoff 55 00000000 55 01 3:thread-local.cpp **** void threadLocal() { 56 .loc 1 3 0 discriminator 1 57 004d 64488B1C movq %fs:0, %rbx 57 25000000 57 00 58 0056 4881C300 addq $threadName@tpoff, %rbx 58 000000 59 005d 488D5424 leaq 15(%rsp), %rdx 59 0F 60 0062 BE000000 movl $.LC0, %esi 60 00 61 0067 4889DF movq %rbx, %rdi 62 006a E8000000 call _ZNSsC1EPKcRKSaIcE 62 00 63 006f BA000000 movl $__dso_handle, %edx 63 00 64 0074 4889DE movq %rbx, %rsi 65 0077 BF000000 movl $_ZNSsD1Ev, %edi 65 00 66 007c E8000000 call __cxa_thread_atexit 66 00 67 0081 4883C410 addq $16, %rsp GAS LISTING /tmp/ccVfdYKF.s page 4 68 .cfi_def_cfa_offset 16 69 0085 5B popq %rbx 70 .cfi_restore 3 71 .cfi_def_cfa_offset 8 72 .L10: 3:thread-local.cpp **** void threadLocal() { 73 .loc 1 3 0 is_stmt 0 74 0086 F3C3 rep ret 75 .cfi_endproc 76 .LFE1403: 78 .globl _ZTH10threadName 79 .set _ZTH10threadName,__tls_init 80 .section .text._ZTW10threadName,"axG",@progbits,_ZTW10threadName,comdat 81 .weak _ZTW10threadName 82 .internal _ZTW10threadName 84 _ZTW10threadName: 85 .LFB1404: 86 .cfi_startproc 87 0000 4883EC08 subq $8, %rsp 88 .cfi_def_cfa_offset 16 89 0004 E8000000 call _ZTH10threadName 89 00 90 0009 64488B04 movq %fs:0, %rax 90 25000000 90 00 91 0012 48050000 addq $threadName@tpoff, %rax 91 0000 92 0018 4883C408 addq $8, %rsp 93 .cfi_def_cfa_offset 8 94 001c C3 ret 95 .cfi_endproc 96 .LFE1404: 98 .section .rodata.str1.1 99 .LC1: 100 000e 6D796E61 .string "myname" 100 6D6500 101 .LC2: 102 0015 74687265 .string "threadLocal name=" 102 61644C6F 102 63616C20 102 6E616D65 102 3D00 103 .text 104 .globl _Z11threadLocalv 106 _Z11threadLocalv: 107 .LFB1243: 5:thread-local.cpp **** threadName = "myname"; 108 .loc 1 5 0 is_stmt 1 109 .cfi_startproc 5:thread-local.cpp **** threadName = "myname"; 110 .loc 1 5 0 111 0088 53 pushq %rbx 112 .cfi_def_cfa_offset 16 113 .cfi_offset 3, -16 6:thread-local.cpp **** 114 .loc 1 6 0 115 0089 E8000000 call _ZTW10threadName GAS LISTING /tmp/ccVfdYKF.s page 5 115 00 116 .LVL4: 117 008e BE000000 movl $.LC1, %esi 117 00 118 0093 4889C7 movq %rax, %rdi 119 0096 E8000000 call _ZNSsaSEPKc 119 00 120 .LVL5: 8:thread-local.cpp **** } 121 .loc 1 8 0 122 009b E8000000 call _ZTW10threadName 122 00 123 .LVL6: 124 00a0 4889C3 movq %rax, %rbx 125 00a3 BE000000 movl $.LC2, %esi 125 00 126 00a8 BF000000 movl $_ZSt4cout, %edi 126 00 127 00ad E8000000 call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc 127 00 128 .LVL7: 129 00b2 4889DE movq %rbx, %rsi 130 00b5 4889C7 movq %rax, %rdi 131 00b8 E8000000 call _ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E 131 00 132 .LVL8: 133 00bd BE000000 movl $_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_, %esi 133 00 134 00c2 4889C7 movq %rax, %rdi 135 00c5 E8000000 call _ZNSolsEPFRSoS_E 135 00 136 .LVL9: 137 .loc 1 9 0 138 00ca 5B popq %rbx 139 .cfi_def_cfa_offset 8 140 00cb C3 ret 141 .cfi_endproc 142 .LFE1243: 145 _GLOBAL__sub_I_threadName: 146 .LFB1405: 147 .loc 1 9 0 148 .cfi_startproc 149 00cc 4883EC08 subq $8, %rsp 150 .cfi_def_cfa_offset 16 151 .loc 1 9 0 152 00d0 BEFFFF00 movl $65535, %esi 152 00 153 00d5 BF010000 movl $1, %edi 153 00 154 00da E821FFFF call _Z41__static_initialization_and_destruction_0ii 154 FF 155 .LVL10: 156 00df 4883C408 addq $8, %rsp 157 .cfi_def_cfa_offset 8 158 00e3 C3 ret 159 .cfi_endproc 160 .LFE1405: GAS LISTING /tmp/ccVfdYKF.s page 6 162 .section .init_array,"aw" 163 .align 8 164 0000 00000000 .quad _GLOBAL__sub_I_threadName 164 00000000 165 .section .tbss,"awT",@nobits 168 __tls_guard: 169 0000 00 .zero 1 170 .globl threadName 171 0001 00000000 .align 8 171 000000 174 threadName: 175 0008 00000000 .zero 8 175 00000000 176 .local _ZStL8__ioinit 177 .comm _ZStL8__ioinit,1,1 178 .text 179 .Letext0: 180 .file 3 "/usr/include/libio.h" 181 .file 4 "/usr/include/stdio.h" 182 .file 5 "<built-in>" 183 .file 6 "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h" 184 .file 7 "/usr/include/wchar.h" 185 .file 8 "/usr/include/c++/4.8/cwchar" 186 .file 9 "/usr/include/c++/4.8/bits/exception_ptr.h" 187 .file 10 "/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h" 188 .file 11 "/usr/include/c++/4.8/bits/char_traits.h" 189 .file 12 "/usr/include/c++/4.8/cstdint" 190 .file 13 "/usr/include/c++/4.8/clocale" 191 .file 14 "/usr/include/c++/4.8/bits/allocator.h" 192 .file 15 "/usr/include/c++/4.8/cstdlib" 193 .file 16 "/usr/include/c++/4.8/cstdio" 194 .file 17 "/usr/include/c++/4.8/bits/basic_string.h" 195 .file 18 "/usr/include/c++/4.8/bits/basic_string.tcc" 196 .file 19 "/usr/include/c++/4.8/initializer_list" 197 .file 20 "/usr/include/c++/4.8/bits/stringfwd.h" 198 .file 21 "/usr/include/c++/4.8/bits/ios_base.h" 199 .file 22 "/usr/include/c++/4.8/cwctype" 200 .file 23 "/usr/include/c++/4.8/ostream" 201 .file 24 "/usr/include/c++/4.8/bits/stl_iterator_base_types.h" 202 .file 25 "/usr/include/c++/4.8/iosfwd" 203 .file 26 "/usr/include/x86_64-linux-gnu/bits/wchar2.h" 204 .file 27 "/usr/include/time.h" 205 .file 28 "/usr/include/c++/4.8/ext/new_allocator.h" 206 .file 29 "/usr/include/c++/4.8/ext/numeric_traits.h" 207 .file 30 "/usr/include/c++/4.8/bits/stl_iterator.h" 208 .file 31 "/usr/include/c++/4.8/debug/debug.h" 209 .file 32 "/usr/include/stdint.h" 210 .file 33 "/usr/include/locale.h" 211 .file 34 "/usr/include/x86_64-linux-gnu/bits/types.h" 212 .file 35 "/usr/include/x86_64-linux-gnu/c++/4.8/bits/atomic_word.h" 213 .file 36 "/usr/include/stdlib.h" 214 .file 37 "/usr/include/x86_64-linux-gnu/bits/stdlib.h" 215 .file 38 "/usr/include/_G_config.h" 216 .file 39 "/usr/include/x86_64-linux-gnu/bits/stdio2.h" 217 .file 40 "/usr/include/wctype.h" 218 .file 41 "/usr/include/c++/4.8/bits/stl_pair.h" GAS LISTING /tmp/ccVfdYKF.s page 7 DEFINED SYMBOLS *ABS*:0000000000000000 thread-local.cpp /tmp/ccVfdYKF.s:5 .text:0000000000000000 _Z41__static_initialization_and_destruction_0ii .bss:0000000000000000 _ZStL8__ioinit /tmp/ccVfdYKF.s:43 .text:0000000000000034 __tls_init /tmp/ccVfdYKF.s:168 .tbss:0000000000000000 __tls_guard /tmp/ccVfdYKF.s:174 .tbss:0000000000000008 threadName /tmp/ccVfdYKF.s:43 .text:0000000000000034 _ZTH10threadName /tmp/ccVfdYKF.s:84 .text._ZTW10threadName:0000000000000000 _ZTW10threadName /tmp/ccVfdYKF.s:106 .text:0000000000000088 _Z11threadLocalv /tmp/ccVfdYKF.s:145 .text:00000000000000cc _GLOBAL__sub_I_threadName UNDEFINED SYMBOLS _ZNSt8ios_base4InitC1Ev __dso_handle _ZNSt8ios_base4InitD1Ev __cxa_atexit _GLOBAL_OFFSET_TABLE_ _ZNSsC1EPKcRKSaIcE _ZNSsD1Ev __cxa_thread_atexit _ZNSsaSEPKc _ZSt4cout _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc _ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_ _ZNSolsEPFRSoS_E