From 35742dd42451041e006ea6990872f77c42f97379 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Fri, 1 Dec 2017 21:52:42 -0500 Subject: [PATCH] Remove darwinisms, use code that works more generally --- src/runtime/x86-64-assem.S | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/runtime/x86-64-assem.S b/src/runtime/x86-64-assem.S index 2cf217b62..2b9dfacd8 100644 --- a/src/runtime/x86-64-assem.S +++ b/src/runtime/x86-64-assem.S @@ -39,10 +39,8 @@ #ifdef POSITION_INDEPENDENT_ASM #define PIC_CALL(x) x@PLT -#define PIC_VAR(x) x(%rip) #else #define PIC_CALL(x) x -#define PIC_VAR(x) x #endif /* Get the right type of alignment. Linux, FreeBSD and OpenBSD @@ -69,7 +67,6 @@ #if !defined(LISP_FEATURE_WIN32) && !defined(LISP_FEATURE_DARWIN) #define TYPE(name) .type name,@function #define SIZE(name) .size name,.-name -#define DOLLAR(name) $(name) #else #define TYPE(name) #define SIZE(name) @@ -91,17 +88,6 @@ #define TRAP int3 #endif -/* - * More Apple assembler hacks - */ - -#if defined(LISP_FEATURE_DARWIN) -/* global symbol x86-64 sym(%rip) hack:*/ -#define GSYM(name) name(%rip) -#else -#define GSYM(name) $name -#endif - .text .globl GNAME(all_threads) @@ -122,11 +108,8 @@ GNAME(call_into_lisp_first_time): movq __msan_param_tls@GOTTPOFF(%rip), %rax movq %rax, (SYMBOL_VALUE_OFFSET+MSAN_PARAM_TLS) #endif -#if defined(LISP_FEATURE_DARWIN) - movq GSYM(GNAME(all_threads)),%rax -#else - movq PIC_VAR(GNAME(all_threads)),%rax -#endif + mov GNAME(all_threads)@GOTPCREL(%rip), %rax + mov (%rax), %rax mov THREAD_CONTROL_STACK_END_OFFSET(%rax) ,%rsp jmp Lstack @@ -182,11 +165,8 @@ Lstack: movq %fs:0, %rax movq GNAME(current_thread)@TPOFF(%rax), %r12 #else -#ifdef LISP_FEATURE_DARWIN - mov GSYM(GNAME(specials)),%rdi -#else - mov PIC_VAR(specials),%rdi -#endif + mov GNAME(specials)@GOTPCREL(%rip),%rdi + mov (%rdi), %rdi call PIC_CALL(GNAME(pthread_getspecific)) mov %rax,%r12 #endif @@ -391,11 +371,8 @@ GNAME(arch_scrub_control_stack): * guard page upper bound in R8, and our hard guard * page upper bound in R9. */ lea -8(%rsp), %rax -#ifdef LISP_FEATURE_DARWIN - mov GSYM(GNAME(os_vm_page_size)),%r9 -#else - mov PIC_VAR(os_vm_page_size),%r9 -#endif + mov GNAME(os_vm_page_size)@GOTPCREL(%rip), %r9 + mov (%r9), %r9 lea (%rsi,%r9), %r8 lea (%rdx,%r9), %r9 -- 2.11.4.GIT