mirror of https://git.musl-libc.org/git/musl
Browse Source
the asm wrapper is needed to get the return address without compiler-specific extensions.rs-1.0
4 changed files with 32 additions and 3 deletions
@ -0,0 +1,8 @@ |
|||||
|
#include <dlfcn.h> |
||||
|
|
||||
|
void *__dlsym(void *, const char *, void *); |
||||
|
|
||||
|
void *dlsym(void *p, const char *s) |
||||
|
{ |
||||
|
return __dlsym(p, s, 0); |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
.text |
||||
|
.global dlsym |
||||
|
.type dlsym,@function |
||||
|
dlsym: |
||||
|
push (%esp) |
||||
|
push 12(%esp) |
||||
|
push 12(%esp) |
||||
|
call __dlsym |
||||
|
add $12,%esp |
||||
|
ret |
||||
@ -0,0 +1,6 @@ |
|||||
|
.text |
||||
|
.global dlsym |
||||
|
.type dlsym,@function |
||||
|
dlsym: |
||||
|
mov (%rsp),%edx |
||||
|
jmp __dlsym |
||||
Loading…
Reference in new issue