From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15782 invoked by alias); 4 Jul 2012 15:14:13 -0000 Received: (qmail 15774 invoked by uid 22791); 4 Jul 2012 15:14:12 -0000 X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=AWL,BAYES_50,RDNS_NONE X-Spam-Check-By: sourceware.org Received: from Unknown (HELO mail.rt-rk.com) (147.91.177.140) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Jul 2012 15:13:47 +0000 Received: from mail.rt-rk.com (mail.localdomain [127.0.0.1]) by mail.rt-rk.com (Postfix) with SMTP id 3E28B25C8D5 for ; Wed, 4 Jul 2012 17:13:40 +0200 (CEST) From: "Petar Jovanovic" To: Subject: patch to RTLD_START to avoid store data below $sp on MIPS Date: Wed, 04 Jul 2012 15:14:00 -0000 Message-ID: <38131C9536FD498AA0679A54D87B1B96@domain.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00008.txt.bz2 Hi everyone, there is a store-data-below-stack-pointer case in RTLD_START in sysdeps/mips/dl-machine.h. Is there any reason to be so? If not, I'd like to propose a small fix for it. Valgrind has detected the issue and reports an error in this region. With the change, it will not report it. Let me know what you think. Thanks. Regards, Petar diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index bc03785..5aabc88 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -266,8 +266,9 @@ do { \ " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\ # Make sure the stack pointer is aligned for _dl_init_internal.\n\ and $2, $29, -2 * " STRINGXP(SZREG) "\n\ - " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\ + move $8, $29\n\ " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\ + " STRINGXP(PTR_S) " $8, 32-" STRINGXP(SZREG) "($29)\n\ " STRINGXP(SAVE_GP(16)) "\n\ # Call the function to run the initializers.\n\ jal _dl_init_internal\n\