From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22285 invoked by alias); 5 Nov 2007 12:50:08 -0000 Received: (qmail 22272 invoked by uid 22791); 5 Nov 2007 12:50:08 -0000 X-Spam-Check-By: sourceware.org Received: from province.act-europe.fr (HELO province.act-europe.fr) (212.157.227.214) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 05 Nov 2007 12:50:05 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-province.act-europe.fr (Postfix) with ESMTP id 141021661B9; Mon, 5 Nov 2007 13:50:03 +0100 (CET) Received: from province.act-europe.fr ([127.0.0.1]) by localhost (province.act-europe.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ufq1-nGbDRhy; Mon, 5 Nov 2007 13:50:02 +0100 (CET) Received: from [10.10.127.242] (dhcp-guest-242.act-europe.fr [10.10.127.242]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by province.act-europe.fr (Postfix) with ESMTP id D5A81165C3E; Mon, 5 Nov 2007 13:50:02 +0100 (CET) In-Reply-To: <1242791C-5637-4943-8527-4388A6C26533@adacore.com> References: <1242791C-5637-4943-8527-4388A6C26533@adacore.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0B28330A-E341-4687-99DA-D38C01D6D6AB@adacore.com> Cc: binutils@sourceware.org Content-Transfer-Encoding: 7bit From: Tristan Gingold Subject: Ping: PATCH (gas): fix XCOFF RTOC addend Date: Mon, 05 Nov 2007 12:50:00 -0000 To: Tristan Gingold X-Mailer: Apple Mail (2.752.3) 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: 2007-11/txt/msg00032.txt.bz2 Just a ping. On Oct 22, 2007, at 3:53 PM, Tristan Gingold wrote: > Hi, > > the current value of RTOC addend is not correct on ppc xcoff > targets: the addend must be relative to the > beginning of the TOC csect and not the the beginning of the .data > section. > This bug occurs very rarely (never) on GCC produced files as toc is > the first csect of the section. > > This simple files: > .csect .dummy[RW] > .long 1 > .toc > .globl xx > .csect .data[RW] > xx: > .long 1 > .toc > LC..0: > .tc xx[TC],xx > .csect .text[PR] > .globl .main > .main: > lwz 0,LC..0(2) > blr > > generates these outputs with native aix as (nm and objdump -dr): > 0000000c d .data > 00000008 d .dummy > 00000000 T .main > 00000000 t .text > 00000010 d TOC > 00000010 d xx > 0000000c D xx > > Disassembly of section .text: > > 00000000 <.main>: > 0: 80 02 00 00 lwz r0,0(r2) ##### offset is 0 > 2: R_TOC xx+0xfffffff0 > 4: 4e 80 00 20 blr > > With the unfixed gas: > 00000010 d .data > 00000008 d .dummy > 00000000 T .main > 00000000 t .text > 0000000c d TOC > 0000000c d xx > 00000010 D xx > > 00000000 <.main>: > 0: 80 02 00 04 l r0,4(r2) ##### wrong offset > 2: R_TOC xx+0xfffffff4 > 4: 4e 80 00 20 br > > With the patch: > > 00000000 <.main>: > 0: 80 02 00 00 l r0,0(r2) ##### Correct offset > 2: R_TOC xx+0xfffffff4 > 4: 4e 80 00 20 br > > Tristan. > > gas: > 2007-10-22 Tristan Gingold > > * config/tc-ppc.c (md_apply_fix): For PPC_TOC16 on XCOFF, > uses offset > within the TOC instead of the VMA. > > > gas/testsuite: > 2007-10-22 Tristan Gingold > > * gas/ppc/test1xcoff32.d: Updated to match RTOC bug fix. > > > *** gas/config/tc-ppc.c 19 Oct 2007 10:48:17 -0000 1.129 > --- gas/config/tc-ppc.c 22 Oct 2007 13:20:45 -0000 > *************** > *** 6059,6068 **** > #ifdef TE_PE > fixP->fx_addnumber = 0; > #else > ! /* We want to use the offset within the data segment of the > ! symbol, not the actual VMA of the symbol. */ > fixP->fx_addnumber = > ! - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP- > >fx_addsy)); > #endif > } > #endif > --- 6059,6069 ---- > #ifdef TE_PE > fixP->fx_addnumber = 0; > #else > ! /* We want to use the offset within the toc, not the actual > VMA > ! of the symbol. */ > fixP->fx_addnumber = > ! - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP- > >fx_addsy)) > ! - S_GET_VALUE (ppc_toc_csect); > #endif > } > #endif > >