summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuba Sejdak <jakub.sejdak@phoesys.com>2016-06-24 14:14:50 +0200
committerCorinna Vinschen <corinna@vinschen.de>2016-06-27 13:23:34 +0200
commitcd169e629ac1891eb4c5e3f7b539186bf80ad394 (patch)
tree21f6a768562a3d43b05bf1fc9a58444fecb0d950
parente5e0bd38d2c62cdb06d143c547a6d80f5ac6a941 (diff)
downloadcygnal-cd169e629ac1891eb4c5e3f7b539186bf80ad394.tar.gz
cygnal-cd169e629ac1891eb4c5e3f7b539186bf80ad394.tar.bz2
cygnal-cd169e629ac1891eb4c5e3f7b539186bf80ad394.zip
Phoenix-RTOS: Provide __progname symbol for user-space apps.
-rw-r--r--newlib/libc/sys/phoenix/machine/arm/crt0.S9
1 files changed, 8 insertions, 1 deletions
diff --git a/newlib/libc/sys/phoenix/machine/arm/crt0.S b/newlib/libc/sys/phoenix/machine/arm/crt0.S
index 7c4869159..0ab7da658 100644
--- a/newlib/libc/sys/phoenix/machine/arm/crt0.S
+++ b/newlib/libc/sys/phoenix/machine/arm/crt0.S
@@ -28,6 +28,7 @@
.global main
.global exit
.global environ
+ .global __progname
.align 4
@@ -36,7 +37,10 @@ _start:
pop {lr}
ldmfd sp, {r0-r2}
ldr r3, =environ
+ ldr r4, =__progname
+ ldr r5, [r1]
str r2, [r3]
+ str r5, [r4]
/* Align stack. */
bic sp, #0x00000007
@@ -44,4 +48,7 @@ _start:
blx lr
ldr lr, =exit
blx lr
- \ No newline at end of file
+
+ .section .data
+__progname:
+ .word 0 \ No newline at end of file