diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-07-08 18:01:51 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-07-08 18:01:51 +0200 |
| commit | ca9bc1361943575724eb5152798aa208ed5eed6c (patch) | |
| tree | 451d2f55ab2ba2f5650cdfa55f8c55c45067a342 /src/wrapped/wrappedldlinux.c | |
| parent | 3f573711aab181f8310d8924edfe010e8a56e20a (diff) | |
| download | box64-ca9bc1361943575724eb5152798aa208ed5eed6c.tar.gz box64-ca9bc1361943575724eb5152798aa208ed5eed6c.zip | |
Better wrapping for __libc_stack_end symbol
Diffstat (limited to 'src/wrapped/wrappedldlinux.c')
| -rwxr-xr-x | src/wrapped/wrappedldlinux.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wrapped/wrappedldlinux.c b/src/wrapped/wrappedldlinux.c index b5dc0da6..83245e93 100755 --- a/src/wrapped/wrappedldlinux.c +++ b/src/wrapped/wrappedldlinux.c @@ -28,6 +28,12 @@ EXPORT void* my___tls_get_addr(void* p) return ptr->data+GetTLSBase(my_context->elfs[t->i])+t->o; } +EXPORT void* my___libc_stack_end; +void stSetup(box64context_t* context) +{ + my___libc_stack_end = context->stack; // is this the end, or should I add stasz? +} + // don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux const char* ldlinuxName = "ld-linux.so.2"; #define LIBNAME ldlinux @@ -37,6 +43,9 @@ const char* ldlinuxName = "ld-linux.so.2"; lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ else +#define CUSTOM_INIT \ + stSetup(box64); \ + // define all standard library functions #include "wrappedlib_init.h" |