From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14330 invoked by alias); 6 Jun 2014 11:23:55 -0000 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 Received: (qmail 14318 invoked by uid 89); 6 Jun 2014 11:23:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.7 required=5.0 tests=AWL,BAYES_00,FOREIGN_BODY,RDNS_DYNAMIC,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.2 X-HELO: mail.embedded-brains.de Received: from host-82-135-62-35.customer.m-online.net (HELO mail.embedded-brains.de) (82.135.62.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jun 2014 11:23:52 +0000 Received: by mail.embedded-brains.de (Postfix, from userid 65534) id CA23D652CFC; Fri, 6 Jun 2014 13:23:49 +0200 (CEST) Received: from [192.168.100.11] (unknown [192.168.100.11]) by mail.embedded-brains.de (Postfix) with ESMTP id 994DB652CF6 for ; Fri, 6 Jun 2014 13:23:48 +0200 (CEST) Message-ID: <5391A4BF.2030308@embedded-brains.de> Date: Fri, 06 Jun 2014 11:23:00 -0000 From: Sebastian Huber User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: binutils@sourceware.org Subject: Re: 32-bit PowerPC sdata linker problem References: <53918356.3040102@embedded-brains.de> <20140606105420.GH5592@bubble.grove.modra.org> In-Reply-To: <20140606105420.GH5592@bubble.grove.modra.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00060.txt.bz2 On 2014-06-06 12:54, Alan Modra wrote: > On Fri, Jun 06, 2014 at 11:01:10AM +0200, Sebastian Huber wrote: >> I performed a git bisect and found this: >> >> 93d1b056cb396d6468781fe0e40dd769891bed32 is the first bad commit >> commit 93d1b056cb396d6468781fe0e40dd769891bed32 >> Author: Alan Modra >> Date: Tue May 20 11:42:42 2014 +0930 >> >> Rewrite ppc32 backend .sdata and .sdata2 handling > > Hmm, I'm surprised that your git bisect found this patch. Was > _SDA_BASE_ set differently before this? A diff -u map.ok map.error yields: @@ -6549,10 +6550,11 @@ 0x0000000000008000 PROVIDE (_SDA_BASE_, 0x8000) *(.sdata .sdata.* .gnu.linkonce.s.*) .sdata 0x00000000000d7c00 0x0 /opt/rtems-4.11/lib64/gcc/powerpc-rtems4.11/4.8.3/m603e/ecrti.o - 0x00000000000d7c00 _SDA_BASE_ 0x00000000000d7c00 __SDATA_START__ .sdata 0x00000000000d7c00 0x4 /opt/rtems-4.11/lib64/gcc/powerpc-rtems4.11/4.8.3/m603e/crtbegin.o 0x00000000000d7c00 __dso_handle + 0x00000000000dfc00 _SDA_BASE_ + .sdata 0x00000000000d7c04 0x0 /opt/rtems-4.11/lib64/gcc/powerpc-rtems4.11/4.8.3/m603e/crtbegin.o .sdata 0x00000000000d7c04 0x4c b-br_uid/init.o 0x00000000000d7c0c rtems_shell_Initial_aliases 0x00000000000d7c14 _RTEMS_tasks_Initialize_user_tasks_p > >> 0x00000000000dfc00 _SDA_BASE_ >> 0x00000000000d7f78 ppc_exc_lock_std > >> 4b8: 28 05 00 00 cmplwi r5,0 >> 4ba: R_PPC_SDAREL16 ppc_exc_lock_std > > ppc_exc_lock_std@sdarel will be calculating 0xd7f78 - 0xdfc00 > which is 0xf...fff8378, and that falls foul of > > commit 86c9573369616e7437481b6e5533aef3a435cdcf > Author: Alan Modra > Date: Sat Mar 8 13:05:06 2014 +1030 > > Better overflow checking for powerpc32 relocations > > cmplwi has an *unsigned* 16-bit field, and we now check the overflow > properly. > > I wonder how many more of these we'll hit, and whether the uproar will > be enough that I'll be forced to relax the checks? > Ok, so this "cmplwi cr0, rX, ppc_exc_lock_std@sdarel" is illegal, since ppc_exc_lock_std@sdarel is signed and the immediate is unsigned 16-bit? The assembler doesn't issue a warning about this. Exists there a way to rescue this cmplwi hack without relaxing the overflow checks? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.