From patchwork Wed Dec 23 16:38:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 560622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 9FE9F140BF9 for ; Thu, 24 Dec 2015 03:38:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 530A592757; Wed, 23 Dec 2015 16:38:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nYqcD98zlHG3; Wed, 23 Dec 2015 16:38:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 4E59B92749; Wed, 23 Dec 2015 16:38:56 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 359711C1029 for ; Wed, 23 Dec 2015 16:38:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 30C8F94BF4 for ; Wed, 23 Dec 2015 16:38:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FTx+ZnlHz2R4 for ; Wed, 23 Dec 2015 16:38:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by hemlock.osuosl.org (Postfix) with ESMTP id 028B693C9E for ; Wed, 23 Dec 2015 16:38:53 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Websense Email Security Gateway with ESMTPS id C685892FFDA01 for ; Wed, 23 Dec 2015 16:38:48 +0000 (GMT) Received: from BAMAIL02.ba.imgtec.org (10.20.40.28) by HHMAIL01.hh.imgtec.org (10.100.10.19) with Microsoft SMTP Server (TLS) id 14.3.235.1; Wed, 23 Dec 2015 16:38:51 +0000 Received: from ubuntu-sellcey.mips.com (10.20.3.214) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server id 14.3.174.1; Wed, 23 Dec 2015 08:38:48 -0800 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Wed, 23 Dec 2015 08:38:48 -0800 From: Steve Ellcey To: Subject: [PATCH] Replace bltzal with lapc for MIPS R6 builds. Date: Wed, 23 Dec 2015 08:38:41 -0800 Message-ID: <1450888721-27573-1-git-send-email-sellcey@imgtec.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Cc: Steve Ellcey X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" The R6 version of MIPS does not support the bltzal instruction. This patch changes dl-startup.h and dl-sysdep.h to use lapc on R6 instead. lapc is a new R6 insruction so older systems need to continue to use bltzal in order to load register $31. Signed-off-by: Steve Ellcey --- ldso/ldso/mips/dl-startup.h | 5 +++++ ldso/ldso/mips/dl-sysdep.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ldso/ldso/mips/dl-startup.h b/ldso/ldso/mips/dl-startup.h index 4d9918d..0cab7be 100644 --- a/ldso/ldso/mips/dl-startup.h +++ b/ldso/ldso/mips/dl-startup.h @@ -37,6 +37,7 @@ __asm__("" #if _MIPS_SIM == _MIPS_SIM_ABI32 " subu $29, 16\n" #endif +# if !defined __mips_isa_rev || __mips_isa_rev < 6 #if _MIPS_SIM == _MIPS_SIM_ABI64 " dla $8, .coff\n" #else /* O32 || N32 */ @@ -44,6 +45,10 @@ __asm__("" #endif /* O32 || N32 */ " bltzal $8, .coff\n" ".coff:\n" +# else + ".coff:\n" + " lapc $31, .coff\n" +# endif #if _MIPS_SIM == _MIPS_SIM_ABI64 " dsubu $8, $31, $8\n" " dla $25, _dl_start\n" diff --git a/ldso/ldso/mips/dl-sysdep.h b/ldso/ldso/mips/dl-sysdep.h index 6041245..b2caa7f 100644 --- a/ldso/ldso/mips/dl-sysdep.h +++ b/ldso/ldso/mips/dl-sysdep.h @@ -225,10 +225,15 @@ elf_machine_load_address (void) { ElfW(Addr) addr; __asm__ (" .set noreorder\n" +# if !defined __mips_isa_rev || __mips_isa_rev < 6 " " STRINGXP (PTR_LA) " %0, 0f\n" " bltzal $0, 0f\n" " nop\n" "0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n" +#else + "0: lapc $31, 0\n" + " " STRINGXP (PTR_SUBU) " %0, $31, %0\n" +#endif " .set reorder\n" : "=r" (addr) : /* No inputs */