about summary refs log tree commit diff
path: root/src/ldso/x86_64
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-05-27 16:01:44 -0400
committerRich Felker <dalias@aerifal.cx>2012-05-27 16:01:44 -0400
commit5c1909a8d210cd08a776a2fd6681dbea1f0ae480 (patch)
tree3e1faad627f164047bfd41ea0b888d370b781561 /src/ldso/x86_64
parentb94608ca10051e7911250aaa53f1435b0512018c (diff)
downloadmusl-5c1909a8d210cd08a776a2fd6681dbea1f0ae480.tar.gz
musl-5c1909a8d210cd08a776a2fd6681dbea1f0ae480.tar.xz
musl-5c1909a8d210cd08a776a2fd6681dbea1f0ae480.zip
add ldd and main program loading support to dynamic linker
Diffstat (limited to 'src/ldso/x86_64')
-rw-r--r--src/ldso/x86_64/start.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ldso/x86_64/start.s b/src/ldso/x86_64/start.s
index 65e238b7..80c1d08d 100644
--- a/src/ldso/x86_64/start.s
+++ b/src/ldso/x86_64/start.s
@@ -4,5 +4,13 @@ _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