Home | History | Annotate | Download | only in i386
      1 	.section ".tdata", "awT", @progbits
      2 	.globl foo
      3 foo:	.long 25
      4 	.text
      5 	.globl	fn
      6 	.type	fn,@function
      7 fn:
      8 	pushl	%ebp
      9 	movl	%esp, %ebp
     10 	pushl	%ebx
     11 	pushl	%eax
     12 	call	1f
     13 1:	popl	%ebx
     14 	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
     15 
     16 	/* foo can be anywhere in the startup TLS  */
     17 	movl	%gs:0, %eax
     18 
     19 	/* Arbitrary instructions in between.  */
     20 	addl	$0, %esi
     21 
     22 	subl	foo@GOTTPOFF(%ebx), %eax
     23 	/* %eax now contains &foo  */
     24 
     25 	/* Now the GNU sequence.  */
     26 	movl	foo@GOTNTPOFF(%ebx), %eax
     27 
     28 	/* Arbitrary instructions in between.  */
     29 	addl	$0, %esi
     30 
     31 	movl	%gs:(%eax), %eax
     32 	/* %eax now contains foo  */
     33 
     34 	movl	%gs:0, %ecx
     35 	addl	foo@GOTNTPOFF(%ebx), %ecx
     36 
     37 	movl    -4(%ebp), %ebx
     38 	leave
     39 	ret
     40