[AARCH64] End frame record chain correctly

Message ID 54539D07.7070107@arm.com
State Committed
Headers

Commit Message

Renlin Li Oct. 31, 2014, 2:30 p.m. UTC
  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.
  

Comments

Marcus Shawcroft Nov. 5, 2014, 10:53 a.m. UTC | #1
On 31 October 2014 14:30, Renlin Li <renlin.li@arm.com> wrote:
> 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.

Surely aarch64-none-linux-gnu ;-)

The bugzilla # for this is 17555:
> ChangeLog:
>
> 2014-10-31  Renlin Li  <Renlin.Li@arm.com>
>
>     * sysdeps/aarch64/start.S: Delete x29 overwritten assignment.

Don't forget the () part of the ChangeLog entry.  Add a reference to
the bugzilla ticket:

     [BZ #17555]
     * sysdeps/aarch64/start.S (_start): Delete x29 overwritten assignment.

Please also add 17555 to the 2.21 section of the NEWS file.

Can you back port this to 2.20 and 2.19 please.

Thanks
/Marcus
  
Renlin Li Nov. 6, 2014, 2:51 p.m. UTC | #2
Hi all,

can anybody help to review this?

Regards,
Renlin Li


On 31/10/14 14:30, Renlin Li wrote:
> 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.
  
Carlos O'Donell Nov. 6, 2014, 3:21 p.m. UTC | #3
On 11/06/2014 09:51 AM, Renlin Li wrote:
> can anybody help to review this?

Please avoid top posting.

Marcus seems to have reviewed it yesterday.

You need to repost your patch with the changes requested
and ask the AArch64 machine maintainer to check it in for
you if you don't have commit access.

Marcus also asked you to provide 2.19 and 2.20 patches.

Cheers,
Carlos.
  

Patch

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