use: wrt ..plt instead no-pie

This commit is contained in:
2024-09-03 14:35:27 +02:00
parent 174a587414
commit 8ae1a6e876
4 changed files with 21 additions and 3 deletions

View File

@ -10,8 +10,8 @@ section .text
mov rbx, rdi
mov rdi, rax
call malloc
call malloc wrt ..plt
cmp rax, 0
je error

View File

@ -1,6 +1,23 @@
extern __errno_location
section .text
global ft_write
ft_write:
mov rax, 1
syscall
cmp rax, 0
jne syscall_failed
ret
syscall_failed:
neg rax
mov rbx, rax
call __errno_location wrt ..plt
mov [rax], rbx
mov rax, -1
ret