summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/ldso/i386/tlsdesc.s
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/ldso/i386/tlsdesc.s')
-rw-r--r--libc-top-half/musl/src/ldso/i386/tlsdesc.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/ldso/i386/tlsdesc.s b/libc-top-half/musl/src/ldso/i386/tlsdesc.s
new file mode 100644
index 0000000..32c8176
--- /dev/null
+++ b/libc-top-half/musl/src/ldso/i386/tlsdesc.s
@@ -0,0 +1,23 @@
+.text
+.global __tlsdesc_static
+.hidden __tlsdesc_static
+.type __tlsdesc_static,@function
+__tlsdesc_static:
+ mov 4(%eax),%eax
+ ret
+
+.global __tlsdesc_dynamic
+.hidden __tlsdesc_dynamic
+.type __tlsdesc_dynamic,@function
+__tlsdesc_dynamic:
+ mov 4(%eax),%eax
+ push %edx
+ mov %gs:4,%edx
+ push %ecx
+ mov (%eax),%ecx
+ mov 4(%eax),%eax
+ add (%edx,%ecx,4),%eax
+ pop %ecx
+ sub %gs:0,%eax
+ pop %edx
+ ret