From patchwork Fri Oct 31 14:30:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renlin Li X-Patchwork-Id: 3510 Received: (qmail 17333 invoked by alias); 31 Oct 2014 14:30:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 17315 invoked by uid 89); 31 Oct 2014 14:30:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Message-ID: <54539D07.7070107@arm.com> Date: Fri, 31 Oct 2014 14:30:31 +0000 From: Renlin Li User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: libc-alpha@sourceware.org CC: marcus Shawcroft Subject: [PATCH][AARCH64]End frame record chain correctly X-MC-Unique: 114103114303300601 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 * 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