From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2697 invoked by alias); 6 May 2011 10:01:46 -0000 Received: (qmail 2688 invoked by uid 22791); 6 May 2011 10:01:45 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TW_BL X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (94.185.240.25) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 06 May 2011 10:01:30 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 06 May 2011 11:01:27 +0100 Received: from [10.1.67.34] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 6 May 2011 11:01:26 +0100 Subject: Re: [ARM] Cortex A8 workarounds for PLT tail calls From: Richard Earnshaw To: Richard Sandiford Cc: binutils@sourceware.org, patches@linaro.org In-Reply-To: References: Date: Fri, 06 May 2011 10:01:00 -0000 Message-Id: <1304676085.5165.3.camel@e102346-lin.cambridge.arm.com> Mime-Version: 1.0 X-MC-Unique: 111050611012703301 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00073.txt.bz2 On Tue, 2011-04-12 at 09:34 +0100, Richard Sandiford wrote: > The linker has some workarounds for a Cortex A8 branch erratum. If a > 32-bit Thumb branch straddles a page boundary, and branches to somewhere > in the first of the two pages, the linker will redirect it to a stub in > a different page. >=20 > This was failing to work correctly for non-call branches to PLTs. The st= ub > is itself a Thumb branch, but it branched directly to the ARM PLT code, > rather than to the preceding Thumb entry point. >=20 > (Normal calls to PLTs work fine. We use a BLX to an ARM stub, > which should and does then branch to the main PLT entry.) >=20 > Tested on arm-linux-gnueabi, both on binutils and GCC. The b-plt and > bcc-plt tests failed before the patch but pass after it. The other two > already passed, but I've included them for completeness. OK to install? >=20 > Richard >=20 >=20 > bfd/ > * elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb > branch to a PLT entry, redirect it to the PLT's Thumb entry point. >=20 > ld/testsuite/ > * ld-arm/cortex-a8-fix-b-plt.s, ld-arm/cortex-a8-fix-b-plt.d, > ld-arm/cortex-a8-fix-bcc-plt.s, ld-arm/cortex-a8-fix-bcc-plt.d, > ld-arm/cortex-a8-fix-bl-plt.s, ld-arm/cortex-a8-fix-bl-plt.d, > ld-arm/cortex-a8-fix-blx-plt.s, ld-arm/cortex-a8-fix-blx-plt.d, > ld-arm/cortex-a8-fix-plt.ld: New tests. > * ld-arm/arm-elf.exp: Run them. >=20 OK. R.