about summary refs log tree commit diff
path: root/src/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'src/ldso')
-rw-r--r--src/ldso/x32/dlsym.s6
-rw-r--r--src/ldso/x32/start.s16
2 files changed, 22 insertions, 0 deletions
diff --git a/src/ldso/x32/dlsym.s b/src/ldso/x32/dlsym.s
new file mode 100644
index 00000000..3c16616a
--- /dev/null
+++ b/src/ldso/x32/dlsym.s
@@ -0,0 +1,6 @@
+.text
+.global dlsym
+.type dlsym,@function
+dlsym:
+	mov (%rsp),%rdx
+	jmp __dlsym
diff --git a/src/ldso/x32/start.s b/src/ldso/x32/start.s
new file mode 100644
index 00000000..80c1d08d
--- /dev/null
+++ b/src/ldso/x32/start.s
@@ -0,0 +1,16 @@
+.text
+.global _start
+_start:
+	mov (%rsp),%rdi
+	lea 8(%rsp),%rsi
+	call __dynlink
+	pop %rdi
+1:	dec %edi
+	pop %rsi
+	cmp $-1,%rsi
+	jz 1b
+	inc %edi
+	push %rsi
+	push %rdi
+	xor %edx,%edx
+	jmp *%rax