crt?.S: fix the build with macOS
This commit is contained in:
parent
a8970f8e6b
commit
ea795c5c4c
|
@ -7,7 +7,11 @@
|
|||
|
||||
/* sections */
|
||||
/* init */
|
||||
#ifdef __APPLE__
|
||||
.section __TEXT,__text
|
||||
#else
|
||||
.section .init
|
||||
#endif
|
||||
.global _init
|
||||
#ifndef __clang__
|
||||
.type _init, @function
|
||||
|
@ -16,9 +20,19 @@ _init:
|
|||
push %rbp
|
||||
mov %rsp, %rbp
|
||||
|
||||
#ifdef __APPLE__
|
||||
.section __DATA,__mod_init_func,mod_init_funcs
|
||||
.p2align 3
|
||||
.quad _init
|
||||
#endif
|
||||
|
||||
|
||||
/* fini */
|
||||
#ifdef __APPLE__
|
||||
.section __TEXT,__text
|
||||
#else
|
||||
.section .fini
|
||||
#endif
|
||||
.global _fini
|
||||
#ifndef __clang__
|
||||
.type _fini, @function
|
||||
|
@ -26,3 +40,9 @@ _init:
|
|||
_fini:
|
||||
push %rbp
|
||||
mov %rsp, %rbp
|
||||
|
||||
#ifdef __APPLE__
|
||||
.section __DATA,__mod_term_func,mod_term_funcs
|
||||
.p2align 3
|
||||
.quad _fini
|
||||
#endif
|
||||
|
|
|
@ -7,12 +7,36 @@
|
|||
|
||||
/* sections */
|
||||
/* init */
|
||||
#ifdef __APPLE__
|
||||
.section __TEXT,__text
|
||||
.global _crtn_init
|
||||
_crtn_init:
|
||||
#else
|
||||
.section .init
|
||||
#endif
|
||||
pop %rbp
|
||||
ret
|
||||
|
||||
#ifdef __APPLE__
|
||||
.section __DATA,__mod_init_func,mod_init_funcs
|
||||
.p2align 3
|
||||
.quad _crtn_init
|
||||
#endif
|
||||
|
||||
|
||||
/* fini */
|
||||
#ifdef __APPLE__
|
||||
.section __TEXT,__text
|
||||
.global _crtn_fini
|
||||
_crtn_fini:
|
||||
#else
|
||||
.section .fini
|
||||
#endif
|
||||
pop %rbp
|
||||
ret
|
||||
|
||||
#ifdef __APPLE__
|
||||
.section __DATA,__mod_term_func,mod_term_funcs
|
||||
.p2align 3
|
||||
.quad _crtn_fini
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user