aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-06-13 11:23:44 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-06-18 11:20:34 -0300
commit8788bd77d68c6429c7f2dcbd22765525555c3cd8 (patch)
treecfd360b33710c59c4c866cddab6b0564675c77c3
parent0dbbc44bfd256683705c391d97c4052320e2e64e (diff)
downloadglibc-8788bd77d68c6429c7f2dcbd22765525555c3cd8.zip
glibc-8788bd77d68c6429c7f2dcbd22765525555c3cd8.tar.gz
glibc-8788bd77d68c6429c7f2dcbd22765525555c3cd8.tar.bz2
sparc: Fix sparc32 Fix argument passing to __libc_start_main (BZ 32981)
Commit 404526ee2e58f3c075253943ddc9988f4bd6b80c changed _start to write the last argument to __libc_start_main without taking into consideration that the function did not create a full stack frame, which leads to overwriting the argv[0].
-rw-r--r--sysdeps/sparc/sparc32/start.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/sparc/sparc32/start.S b/sysdeps/sparc/sparc32/start.S
index cef7c96..8393760 100644
--- a/sysdeps/sparc/sparc32/start.S
+++ b/sysdeps/sparc/sparc32/start.S
@@ -35,6 +35,7 @@
#include <sysdep.h>
+#define FRAME_SIZE 104
.section ".text"
.align 4
@@ -48,12 +49,12 @@ _start:
/* Terminate the stack frame, and reserve space for functions to
drop their arguments. */
mov %g0, %fp
- sub %sp, 6*4, %sp
+ sub %sp, FRAME_SIZE, %sp
/* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP. */
- ld [%sp+22*4], %o1
- add %sp, 23*4, %o2
+ ld [%sp+168], %o1
+ add %sp, 172, %o2
/* Load the addresses of the user entry points. */
#ifndef PIC