This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][AARCH64]End frame record chain correctly
- From: Renlin Li <renlin dot li at arm dot com>
- To: libc-alpha at sourceware dot org
- Cc: marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Fri, 31 Oct 2014 14:30:31 +0000
- Subject: [PATCH][AARCH64]End frame record chain correctly
- Authentication-results: sourceware.org; auth=none
Hi all,
This is a simple patch to make the end of frame record chain correctly
according to AArch64 AAPCS.
Currently, the FP(x29) is overwritten by SP in the very beginning of _start.
aarch64-none-linux-gnueabi target has been tested on the model. No new
issues.
Is this Okay to commit?
From the Procedure Call Standard for ARM 64-bit Architecture
documentation:
"Conforming code shall construct a linked list of stack-frames. Each
frame shall link to the frame of its caller by means of a frame record
of two 64-bit values on the stack. The frame record for the innermost
frame (belonging to the most recent routine invocation) shall be pointed
to by the Frame Pointer register (FP). The lowest addressed double-word
shall point to the previous frame record and the highest addressed
double-word shall contain the value passed in LR on entry to the current
function. The end of the frame record chain is indicated by the address
zero in the address for the previous frame."
ChangeLog:
2014-10-31 Renlin Li <Renlin.Li@arm.com>
* sysdeps/aarch64/start.S: Delete x29 overwritten assignment.
diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
index 35d603a..69b45ea 100644
--- a/sysdeps/aarch64/start.S
+++ b/sysdeps/aarch64/start.S
@@ -47,7 +47,6 @@ _start:
/* Create an initial frame with 0 LR and FP */
mov x29, #0
mov x30, #0
- mov x29, sp
/* Setup rtld_fini in argument register */
mov x5, x0