From ca4de7a9b1e5415258e3f697c240ba2fa359bfa4 Mon Sep 17 00:00:00 2001 From: drepper Date: Thu, 4 Dec 1997 00:08:00 +0000 Subject: [PATCH] When cloned process returns load GOT ptr before jumping to _exit. --- sysdeps/unix/sysv/linux/i386/clone.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index 7f758a52a8..0aec95e219 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -23,6 +23,7 @@ #include #define _ERRNO_H 1 #include +#include /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ @@ -63,6 +64,12 @@ ENTRY(__clone) thread_start: subl %ebp,%ebp /* terminate the stack frame */ call *%ebx +#ifdef PIC + call L(here) +L(here): + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx +#endif pushl %eax call JUMPTARGET (_exit) -- 2.11.0