This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/9] Phoenix-RTOS: Provide __progname symbol for user-space apps.


From: Kuba Sejdak <jakub.sejdak@phoesys.com>

---
 newlib/libc/sys/phoenix/machine/arm/crt0.S | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/phoenix/machine/arm/crt0.S b/newlib/libc/sys/phoenix/machine/arm/crt0.S
index 7c48691..0ab7da6 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
-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]