summaryrefslogblamecommitdiff
path: root/src/ldso/i386/tlsdesc.s
blob: 3ac6129777c3da550e8c8bccd4b24b313c835e03 (plain) (tree)


























                                 
.text
.global __tlsdesc_static
.type __tlsdesc_static,@function
__tlsdesc_static:
	mov 4(%eax),%eax
	ret

.global __tlsdesc_dynamic
.type __tlsdesc_dynamic,@function
__tlsdesc_dynamic:
	mov 4(%eax),%eax
	push %edx
	mov %gs:4,%edx
	push %ecx
	mov (%eax),%ecx
	cmp %ecx,(%edx)
	jc 1f
	mov 4(%eax),%eax
	add (%edx,%ecx,4),%eax
2:	pop %ecx
	sub %gs:0,%eax
	pop %edx
	ret
1:	push %eax
	call __tls_get_addr
	pop %ecx
	jmp 2b