From a92699fe585f1f02a300d69620c0a098b1e12d9c Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 17 Nov 2011 11:12:59 -0800 Subject: [PATCH] rt: Make morestack link on x86_64. Still utterly broken --- src/rt/arch/x86_64/morestack.S | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S index b19ec151537..e7464dfdc0e 100644 --- a/src/rt/arch/x86_64/morestack.S +++ b/src/rt/arch/x86_64/morestack.S @@ -8,9 +8,11 @@ #if defined(__APPLE__) || defined(_WIN32) #define RUST_NEW_STACK _rust_new_stack #define RUST_DEL_STACK _rust_del_stack +#define MORESTACK __morestack #else #define RUST_NEW_STACK rust_new_stack #define RUST_DEL_STACK rust_del_stack +#define MORESTACK __morestack #endif // Naturally, nobody can agree as to @@ -29,16 +31,16 @@ .globl RUST_NEW_STACK .globl RUST_DEL_STACK -.globl __morestack +.globl MORESTACK -__morestack: +MORESTACK: // Hastily and probably incorrectly ported from i386 version. // Actually this calling convention doens't make so much sense // for x86_64... mov %rcx, ARG0 // param 0: amount of space needed mov %rdx, ARG2 // param 2: size of arguments lea 8(%rsp),ARG1 - call RUST_NEW_STACK + call rust_new_stack_sym mov (%rsp),%rdx // Grab the return pointer. inc %rdx // Skip past the `ret`. @@ -47,6 +49,10 @@ __morestack: // Now the function that called us has returned, so we need to delete the // old stack space. - call RUST_DEL_STACK + call rust_new_stack_sym mov %rax,%rsp // Switch back to the old stack. ret + +// This is totally broken +rust_new_stack_sym: +rust_del_stack_sym: \ No newline at end of file