commit 6042e799273e80d79daeaaed441a8913d7ee69a3
parent e7226564b6c9c19ebe7e9462553d22795e1c4b33
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 19 Apr 2020 15:58:44 +0200
libc: Use common symbols for _environ
.bss + long/quad doesn't guarantee a correct definition of global not
initialize symbols. The correct definition must be a common block.
Diffstat:
4 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/libc/arch/amd64/crt-posix.s b/src/libc/arch/amd64/crt-posix.s
@@ -1,7 +1,5 @@
- .bss
.globl _environ
-_environ:
- .quad 0
+ .comm _environ,8,8
.text
.globl _start
diff --git a/src/libc/arch/arm32/crt-posix.s b/src/libc/arch/arm32/crt-posix.s
@@ -1,7 +1,5 @@
- .bss
.globl _environ
-_environ:
- .word 0
+ .comm _environ,4,4
.text
.globl _start
diff --git a/src/libc/arch/arm64/crt-posix.s b/src/libc/arch/arm64/crt-posix.s
@@ -1,7 +1,5 @@
- .bss
.globl _environ
-_environ:
- .quad 0
+ .comm _environ,8,8
.text
.globl _start
diff --git a/src/libc/arch/i386/crt-posix.s b/src/libc/arch/i386/crt-posix.s
@@ -1,10 +1,8 @@
- .bss
.globl _environ
-_environ:
- .long 0
+ .comm _environ,4,4
- .text
.globl _start
+ .text
_start:
movl %esp,%ebp