summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/ldso/aarch64
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/src/ldso/aarch64
parentInitial commit. (diff)
downloadwasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.tar.xz
wasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/src/ldso/aarch64')
-rw-r--r--libc-top-half/musl/src/ldso/aarch64/dlsym.s6
-rw-r--r--libc-top-half/musl/src/ldso/aarch64/tlsdesc.s31
2 files changed, 37 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/ldso/aarch64/dlsym.s b/libc-top-half/musl/src/ldso/aarch64/dlsym.s
new file mode 100644
index 0000000..abaae4d
--- /dev/null
+++ b/libc-top-half/musl/src/ldso/aarch64/dlsym.s
@@ -0,0 +1,6 @@
+.global dlsym
+.hidden __dlsym
+.type dlsym,%function
+dlsym:
+ mov x2,x30
+ b __dlsym
diff --git a/libc-top-half/musl/src/ldso/aarch64/tlsdesc.s b/libc-top-half/musl/src/ldso/aarch64/tlsdesc.s
new file mode 100644
index 0000000..c6c685b
--- /dev/null
+++ b/libc-top-half/musl/src/ldso/aarch64/tlsdesc.s
@@ -0,0 +1,31 @@
+// size_t __tlsdesc_static(size_t *a)
+// {
+// return a[1];
+// }
+.global __tlsdesc_static
+.hidden __tlsdesc_static
+.type __tlsdesc_static,@function
+__tlsdesc_static:
+ ldr x0,[x0,#8]
+ ret
+
+// size_t __tlsdesc_dynamic(size_t *a)
+// {
+// struct {size_t modidx,off;} *p = (void*)a[1];
+// size_t *dtv = *(size_t**)(tp - 8);
+// return dtv[p->modidx] + p->off - tp;
+// }
+.global __tlsdesc_dynamic
+.hidden __tlsdesc_dynamic
+.type __tlsdesc_dynamic,@function
+__tlsdesc_dynamic:
+ stp x1,x2,[sp,#-16]!
+ mrs x1,tpidr_el0 // tp
+ ldr x0,[x0,#8] // p
+ ldp x0,x2,[x0] // p->modidx, p->off
+ sub x2,x2,x1 // p->off - tp
+ ldr x1,[x1,#-8] // dtv
+ ldr x1,[x1,x0,lsl #3] // dtv[p->modidx]
+ add x0,x1,x2 // dtv[p->modidx] + p->off - tp
+ ldp x1,x2,[sp],#16
+ ret