diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-02-23 18:14:36 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-24 20:44:03 +0100 |
commit | 91689649656314b04f3dbee0415a9254eb1424dd (patch) | |
tree | 4d0010b61186bf954ab7d74cc92c62455b136678 /sysdeps | |
parent | b020355f382b658b3b99e8e3575dd16f8757a148 (diff) | |
download | glibc-91689649656314b04f3dbee0415a9254eb1424dd.tar glibc-91689649656314b04f3dbee0415a9254eb1424dd.tar.gz glibc-91689649656314b04f3dbee0415a9254eb1424dd.tar.bz2 glibc-91689649656314b04f3dbee0415a9254eb1424dd.zip |
hurd: Generalize init-first.c to support x86_64
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230223151436.49180-2-bugaevc@gmail.com>
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/x86/init-first.c (renamed from sysdeps/mach/hurd/i386/init-first.c) | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/x86/init-first.c index 05424563bf..2fccaefdd2 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/x86/init-first.c @@ -225,9 +225,15 @@ _hurd_stack_setup (void) void doinit (intptr_t *data) { init ((void **) data); +# ifdef __x86_64__ + asm volatile ("movq %0, %%rsp\n" /* Switch to new outermost stack. */ + "xorq %%rbp, %%rbp\n" /* Clear outermost frame pointer. */ + "jmp *%1" : : "r" (data), "r" (caller)); +# else asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack. */ "xorl %%ebp, %%ebp\n" /* Clear outermost frame pointer. */ "jmp *%1" : : "r" (data), "r" (caller)); +# endif __builtin_unreachable (); } |