From 51e2d8310222ddd4d4e895f55c627100d863aa95 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 18 Jun 2011 19:48:42 -0400 Subject: experimental dynamic linker! some notes: - library search path is hard coded - x86_64 code is untested and may not work - dlopen/dlsym is not yet implemented - relocations in read-only memory won't work --- src/ldso/i386/start.s | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/ldso/i386/start.s (limited to 'src/ldso/i386/start.s') diff --git a/src/ldso/i386/start.s b/src/ldso/i386/start.s new file mode 100644 index 00000000..47c2748b --- /dev/null +++ b/src/ldso/i386/start.s @@ -0,0 +1,19 @@ +.text +.global _start +_start: + xorl %ebp,%ebp + popl %ecx + movl %esp,%eax + andl $-16,%esp + movl %eax,%esi + movl %ecx,%edi + pushl %ebp + call 1f +1: addl $_GLOBAL_OFFSET_TABLE_,(%esp) + pushl %eax + pushl %ecx + call __dynlink + movl %esi,%esp + pushl %edi + xorl %edx,%edx + jmp *%eax -- cgit v1.2.1