.file "threadtest.c" .section ".got","aw" .section ".text" .section .rodata .align 3 .LC0: .string "Thread %.16llx: Entered\n" .section ".got","aw" .LC1: .tc .LC0[TC],.LC0 .section ".text" .align 2 .globl theThread .section ".opd","aw" .align 3 theThread: .quad .L.theThread,.TOC.@tocbase,0 .previous .type theThread, @function .L.theThread: mflr 0 std 31,-8(1) std 0,16(1) stdu 1,-144(1) mr 31,1 std 3,192(31) bl pthread_getthreadid_np cror 31,31,31 mr 0,3 ld 3,.LC1@toc(2) mr 4,0 bl printf cror 31,31,31 ld 0,192(31) std 0,112(31) ld 9,112(31) lwz 0,0(9) extsw 0,0 addis 9,13,TLS_data1@tprel@ha addi 9,9,TLS_data1@tprel@l stw 0,0(9) ld 9,112(31) lwz 0,4(9) extsw 0,0 addis 9,13,TLS_data2@tprel@ha addi 9,9,TLS_data2@tprel@l stw 0,0(9) bl foo cror 31,31,31 li 0,0 mr 3,0 ld 1,0(1) ld 0,16(1) mtlr 0 ld 31,-8(1) blr .long 0 .byte 0,0,0,1,128,1,0,1 .size theThread,.-.L.theThread .section .rodata .align 3 .LC2: .string "Thread %.16llx: foo(), TLS data=%d %d\n" .section ".got","aw" .LC3: .tc .LC2[TC],.LC2 .section ".text" .align 2 .globl foo .section ".opd","aw" .align 3 foo: .quad .L.foo,.TOC.@tocbase,0 .previous .type foo, @function .L.foo: mflr 0 std 31,-8(1) std 0,16(1) stdu 1,-128(1) mr 31,1 bl pthread_getthreadid_np cror 31,31,31 mr 0,3 mr 10,0 addis 9,13,TLS_data1@tprel@ha addi 9,9,TLS_data1@tprel@l lwz 0,0(9) extsw 11,0 addis 9,13,TLS_data2@tprel@ha addi 9,9,TLS_data2@tprel@l lwz 0,0(9) extsw 0,0 ld 3,.LC3@toc(2) mr 4,10 mr 5,11 mr 6,0 bl printf cror 31,31,31 bl bar cror 31,31,31 ld 1,0(1) ld 0,16(1) mtlr 0 ld 31,-8(1) blr .long 0 .byte 0,0,0,1,128,1,0,1 .size foo,.-.L.foo .section .rodata .align 3 .LC4: .string "Thread %.16llx: bar(), TLS data=%d %d\n" .section ".got","aw" .LC5: .tc .LC4[TC],.LC4 .section ".text" .align 2 .globl bar .section ".opd","aw" .align 3 bar: .quad .L.bar,.TOC.@tocbase,0 .previous .type bar, @function .L.bar: mflr 0 std 31,-8(1) std 0,16(1) stdu 1,-128(1) mr 31,1 bl pthread_getthreadid_np cror 31,31,31 mr 0,3 mr 10,0 addis 9,13,TLS_data1@tprel@ha addi 9,9,TLS_data1@tprel@l lwz 0,0(9) extsw 11,0 addis 9,13,TLS_data2@tprel@ha addi 9,9,TLS_data2@tprel@l lwz 0,0(9) extsw 0,0 ld 3,.LC5@toc(2) mr 4,10 mr 5,11 mr 6,0 bl printf cror 31,31,31 ld 1,0(1) ld 0,16(1) mtlr 0 ld 31,-8(1) blr .long 0 .byte 0,0,0,1,128,1,0,1 .size bar,.-.L.bar .section .rodata .align 3 .LC6: .string "Enter Testcase - %s\n" .align 3 .LC8: .string "Create/start threads" .align 3 .LC11: .string "Failed with %d at %s" .align 3 .LC12: .string "pthread_create()\n" .align 3 .LC15: .string "Wait for the threads to complete, and release their resources" .align 3 .LC17: .string "pthread_join()\n" .align 3 .LC19: .string "Main completed" .section ".got","aw" .LC7: .tc .LC6[TC],.LC6 .LC9: .tc .LC8[TC],.LC8 .LC10: .tc theThread[TC],theThread .LC13: .tc .LC11[TC],.LC11 .LC14: .tc .LC12[TC],.LC12 .LC16: .tc .LC15[TC],.LC15 .LC18: .tc .LC17[TC],.LC17 .LC20: .tc .LC19[TC],.LC19 .section ".text" .align 2 .globl main .section ".opd","aw" .align 3 main: .quad .L.main,.TOC.@tocbase,0 .previous .type main, @function .L.main: mflr 0 std 31,-8(1) std 0,16(1) stdu 1,-176(1) mr 31,1 mr 0,3 std 4,232(31) stw 0,224(31) li 0,0 stw 0,116(31) ld 9,232(31) ld 0,0(9) ld 3,.LC7@toc(2) mr 4,0 bl printf cror 31,31,31 ld 3,.LC9@toc(2) bl puts cror 31,31,31 li 0,0 stw 0,112(31) b .L8 .L9: lwz 0,112(31) extsw 0,0 sldi 9,0,3 addi 0,31,112 add 9,9,0 addi 9,9,24 lwz 0,112(31) stw 0,0(9) lwz 0,112(31) extsw 10,0 lwz 9,112(31) addi 0,9,1 extsw 0,0 slwi 0,0,1 extsw 11,0 sldi 9,10,3 addi 0,31,112 add 9,9,0 addi 9,9,24 stw 11,4(9) lwz 0,112(31) extsw 0,0 sldi 0,0,3 addi 9,31,120 add 9,9,0 lwz 0,112(31) extsw 0,0 sldi 0,0,3 mr 11,0 addi 0,31,136 add 0,0,11 mr 3,9 li 4,0 ld 5,.LC10@toc(2) mr 6,0 bl pthread_create cror 31,31,31 mr 0,3 stw 0,116(31) lwz 0,116(31) cmpwi 7,0,0 beq 7,.L10 lwz 0,116(31) extsw 0,0 ld 3,.LC13@toc(2) mr 4,0 ld 5,.LC14@toc(2) bl printf cror 31,31,31 li 3,1 bl exit cror 31,31,31 .L10: lwz 9,112(31) addi 0,9,1 stw 0,112(31) .L8: lwz 0,112(31) cmpwi 7,0,1 ble 7,.L9 ld 3,.LC16@toc(2) bl puts cror 31,31,31 li 0,0 stw 0,112(31) b .L13 .L14: lwz 0,112(31) extsw 0,0 sldi 9,0,3 addi 0,31,112 add 9,9,0 addi 9,9,8 ld 0,0(9) mr 3,0 li 4,0 bl pthread_join cror 31,31,31 mr 0,3 stw 0,116(31) lwz 0,116(31) cmpwi 7,0,0 beq 7,.L15 lwz 0,116(31) extsw 0,0 ld 3,.LC13@toc(2) mr 4,0 ld 5,.LC18@toc(2) bl printf cror 31,31,31 li 3,1 bl exit cror 31,31,31 .L15: lwz 9,112(31) addi 0,9,1 stw 0,112(31) .L13: lwz 0,112(31) cmpwi 7,0,1 ble 7,.L14 ld 3,.LC20@toc(2) bl puts cror 31,31,31 li 0,0 mr 3,0 ld 1,0(1) ld 0,16(1) mtlr 0 ld 31,-8(1) blr .long 0 .byte 0,0,0,1,128,1,0,1 .size main,.-.L.main .globl TLS_data1 .section .tbss,"awT",@nobits .align 2 .type TLS_data1, @object .size TLS_data1, 4 TLS_data1: .zero 4 .globl TLS_data2 .align 2 .type TLS_data2, @object .size TLS_data2, 4 TLS_data2: .zero 4 .ident "GCC: (GNU) 4.2.1 20070831 patched [FreeBSD]" .section .note.GNU-stack,"",@progbits