Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move global outside text section #10

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ft_create_elem.s
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
bits 64

%include "ft_list.s"

extern malloc

%include "ft_list.s"
global ft_create_elem

section .note.GNU-stack

section .text
global ft_create_elem

;typedef struct s_list
;{
; void *data;
Expand Down
7 changes: 3 additions & 4 deletions src/ft_list_push_front.s
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
bits 64

%include "ft_list.s"

extern malloc
extern ft_create_elem

%include "ft_list.s"

global ft_list_push_front

section .note.GNU-stack

section .text
global ft_list_push_front

;typedef struct s_list
;{
; void *data;
Expand Down
4 changes: 2 additions & 2 deletions src/ft_list_remove_if.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ bits 64

extern free

global ft_list_remove_if

section .note.GNU-stack

section .text
global ft_list_remove_if

;typedef struct s_list
;{
; void *data;
Expand Down
4 changes: 2 additions & 2 deletions src/ft_list_size.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ bits 64

%include "ft_list.s"

global ft_list_size

section .note.GNU-stack

section .text
global ft_list_size

;typedef struct s_list
;{
; void *data;
Expand Down
3 changes: 2 additions & 1 deletion src/ft_list_sort.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ bits 64

section .note.GNU-stack

global ft_list_sort

section .text
global ft_list_sort

;typedef struct s_list
;{
Expand Down
4 changes: 2 additions & 2 deletions src/ft_read.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ bits 64

extern __errno_location

global ft_read

section .note.GNU-stack

section .text
global ft_read

; ssize_t ft_read(int fd, void *buf, size_t count);
ft_read:
xor rax, rax
Expand Down
4 changes: 2 additions & 2 deletions src/ft_strcmp.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
bits 64

global ft_strcmp

section .note.GNU-stack

section .text
global ft_strcmp

; int ft_strcmp(const char *s1, const char *s2);
ft_strcmp:
xor rax, rax
Expand Down
4 changes: 2 additions & 2 deletions src/ft_strcpy.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
bits 64

global ft_strcpy

section .note.GNU-stack

section .text
global ft_strcpy

; char *ft_strcpy(char *dst, const char *src);
ft_strcpy:
xor rcx, rcx
Expand Down
6 changes: 3 additions & 3 deletions src/ft_strdup.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ extern ft_strlen
extern ft_strcpy
extern malloc

global ft_strdup

section .note.GNU-stack

; char *ft_strdup(const char *s1);
section .text
global ft_strdup

; char *ft_strdup(const char *s1);
ft_strdup:
call ft_strlen
push rdi
Expand Down
4 changes: 2 additions & 2 deletions src/ft_strlen.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
bits 64

global ft_strlen

section .note.GNU-stack

section .text
global ft_strlen

; size_t ft_strlen(const char *str);
ft_strlen:
xor rax, rax
Expand Down
4 changes: 2 additions & 2 deletions src/ft_write.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ bits 64

extern __errno_location

global ft_write

section .note.GNU-stack

section .text
global ft_write

; ssize_t ft_write(int fd, const void *buf, size_t count);
ft_write:
mov rax, 1
Expand Down