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