mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
sparc: Fix sparc32 Fix argument passing to __libc_start_main (BZ 32981)
Commit 404526ee2e
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].
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
|
#define FRAME_SIZE 104
|
||||||
|
|
||||||
.section ".text"
|
.section ".text"
|
||||||
.align 4
|
.align 4
|
||||||
@@ -48,12 +49,12 @@ _start:
|
|||||||
/* Terminate the stack frame, and reserve space for functions to
|
/* Terminate the stack frame, and reserve space for functions to
|
||||||
drop their arguments. */
|
drop their arguments. */
|
||||||
mov %g0, %fp
|
mov %g0, %fp
|
||||||
sub %sp, 6*4, %sp
|
sub %sp, FRAME_SIZE, %sp
|
||||||
|
|
||||||
/* Extract the arguments and environment as encoded on the stack. The
|
/* Extract the arguments and environment as encoded on the stack. The
|
||||||
argument info starts after one register window (16 words) past the SP. */
|
argument info starts after one register window (16 words) past the SP. */
|
||||||
ld [%sp+22*4], %o1
|
ld [%sp+168], %o1
|
||||||
add %sp, 23*4, %o2
|
add %sp, 172, %o2
|
||||||
|
|
||||||
/* Load the addresses of the user entry points. */
|
/* Load the addresses of the user entry points. */
|
||||||
#ifndef PIC
|
#ifndef PIC
|
||||||
|
Reference in New Issue
Block a user