mirror of
git://git.musl-libc.org/musl
synced 2024-12-14 18:55:23 +00:00
add tlsdesc support for i386
This commit is contained in:
parent
880c479f0e
commit
4e0b4a5de7
@ -26,6 +26,8 @@ static int remap_rel(int type)
|
||||
return REL_TPOFF;
|
||||
case R_386_TLS_TPOFF32:
|
||||
return REL_TPOFF_NEG;
|
||||
case R_386_TLS_DESC:
|
||||
return REL_TLSDESC;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
27
src/ldso/i386/tlsdesc.s
Normal file
27
src/ldso/i386/tlsdesc.s
Normal file
@ -0,0 +1,27 @@
|
||||
.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
|
Loading…
Reference in New Issue
Block a user