aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-24 11:49:02 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-24 11:49:02 +0100
commita2347a0780a90d9f7add3f63a9752229262eedc2 (patch)
tree2b6fb558efba349483bcbbced6fcdfc9cef0c00f
parentd6240e3f6aeb342aaf13284c7cc93226970648aa (diff)
downloadlibasm-a2347a0780a90d9f7add3f63a9752229262eedc2.tar.gz
libasm-a2347a0780a90d9f7add3f63a9752229262eedc2.tar.bz2
libasm-a2347a0780a90d9f7add3f63a9752229262eedc2.zip
Fixing compilation on OSX by moving wrt..plt in LINUX preprocessing directives
-rw-r--r--ft_list_push_front.s4
-rw-r--r--ft_list_remove_if.s4
-rw-r--r--ft_read.s4
-rw-r--r--ft_strdup.s4
-rw-r--r--ft_write.s4
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