From a2347a0780a90d9f7add3f63a9752229262eedc2 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 24 Feb 2021 11:49:02 +0100 Subject: Fixing compilation on OSX by moving wrt..plt in LINUX preprocessing directives --- ft_list_push_front.s | 4 ++-- ft_list_remove_if.s | 4 ++-- ft_read.s | 4 ++-- ft_strdup.s | 4 ++-- ft_write.s | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ft_list_push_front.s b/ft_list_push_front.s index 4eedf75..072f1e7 100644 --- a/ft_list_push_front.s +++ b/ft_list_push_front.s @@ -12,7 +12,7 @@ %ifdef __LINUX__ %define M_FT_LIST_PUSH_FRONT ft_list_push_front - %define M_MALLOC malloc + %define M_MALLOC malloc wrt ..plt %else %define M_FT_LIST_PUSH_FRONT _ft_list_push_front %define M_MALLOC _malloc @@ -31,7 +31,7 @@ M_FT_LIST_PUSH_FRONT: push rsi xor rdi, rdi mov edi, 16 - call M_MALLOC wrt ..plt + call M_MALLOC pop rsi pop rdi cmp rax, 0 diff --git a/ft_list_remove_if.s b/ft_list_remove_if.s index 61f3410..e415768 100644 --- a/ft_list_remove_if.s +++ b/ft_list_remove_if.s @@ -12,7 +12,7 @@ %ifdef __LINUX__ %define M_FT_LIST_REMOVE_IF ft_list_remove_if - %define M_FREE free + %define M_FREE free wrt ..plt %else %define M_FT_LIST_REMOVE_IF _ft_list_remove_if %define M_FREE _free @@ -88,7 +88,7 @@ FT_LIST_REMOVE_IF_REMOVE: EXTERN_FUNCTION_SAVE mov rdi, [rdi] - call M_FREE wrt ..plt ; free(*begin_list) + call M_FREE ; free(*begin_list) EXTERN_FUNCTION_SAVE_END mov rax, [rbp - 8] diff --git a/ft_read.s b/ft_read.s index 1728430..2891045 100644 --- a/ft_read.s +++ b/ft_read.s @@ -12,7 +12,7 @@ %ifdef __LINUX__ %define M_FT_READ ft_read - %define M_ERRNO_LOCATION __errno_location + %define M_ERRNO_LOCATION __errno_location wrt ..plt %define M_SYSCALL_READ 0x0 %else %define M_FT_READ _ft_read @@ -41,7 +41,7 @@ FT_READ_ERROR: neg rax %endif push rax - call M_ERRNO_LOCATION wrt ..plt + call M_ERRNO_LOCATION pop qword [rax] mov rax, -1 ret diff --git a/ft_strdup.s b/ft_strdup.s index 09ae2ba..7de9077 100644 --- a/ft_strdup.s +++ b/ft_strdup.s @@ -15,7 +15,7 @@ %define M_FT_STRDUP ft_strdup %define M_FT_STRLEN ft_strlen %define M_FT_STRCPY ft_strcpy - %define M_MALLOC malloc + %define M_MALLOC malloc wrt ..plt %else %define M_FT_STRDUP _ft_strdup %define M_FT_STRLEN _ft_strlen @@ -38,7 +38,7 @@ M_FT_STRDUP: inc rax ; len++ for '\0' mov rdi, rax ; size to malloc - call M_MALLOC wrt ..plt + call M_MALLOC cmp rax, 0 je FT_STRDUP_ERROR diff --git a/ft_write.s b/ft_write.s index 0d723f7..2c0d706 100644 --- a/ft_write.s +++ b/ft_write.s @@ -12,7 +12,7 @@ %ifdef __LINUX__ %define M_FT_WRITE ft_write - %define M_ERRNO_LOCATION __errno_location + %define M_ERRNO_LOCATION __errno_location wrt ..plt %define M_SYSCALL_WRITE 0x1 %else %define M_FT_WRITE _ft_write @@ -41,7 +41,7 @@ FT_WRITE_ERROR: neg rax %endif push rax - call M_ERRNO_LOCATION wrt ..plt + call M_ERRNO_LOCATION pop qword [rax] mov rax, -1 ret -- cgit