From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23832 invoked by alias); 5 May 2011 08:50:17 -0000 Received: (qmail 23805 invoked by uid 22791); 5 May 2011 08:50:14 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx3-phx2.redhat.com (HELO mx3-phx2.redhat.com) (209.132.183.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 08:49:55 +0000 Received: from mail06.corp.redhat.com (zmail06.collab.prod.int.phx2.redhat.com [10.5.5.45]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p458nsHh005271; Thu, 5 May 2011 04:49:54 -0400 Date: Thu, 05 May 2011 08:50:00 -0000 From: Kai Tietz To: Dave Korn Cc: Nick Clifton , Kai Tietz , "H.J. Lu" , Binutils , Alan Modra , Jan Kratochvil Message-ID: <1550467187.247208.1304585393998.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> In-Reply-To: <4DC1EF60.5050308@gmail.com> Subject: Re: gas -Werror compilation break [Re: [patch ld bfd gas]: Handle linkonce for cfi generated debug_frame and eh_frame data] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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/msg00063.txt.bz2 ----- Original Message ----- From: "Dave Korn" To: "Jan Kratochvil" Cc: "Kai Tietz" , "Nick Clifton" , "Ka= i Tietz" , "H.J. Lu" , "Binut= ils" , "Alan Modra" Sent: Thursday, May 5, 2011 2:29:20 AM Subject: Re: gas -Werror compilation break [Re: [patch ld bfd gas]: Handle= linkonce for cfi generated debug_frame and eh_frame data] On 27/04/2011 21:34, Jan Kratochvil wrote: > Hi Kai, >=20 > On Tue, 26 Apr 2011 17:30:08 +0200, Nick Clifton wrote: >>>>> ChangeLog gas/ >>>>> 2011-04-18 Kai Tietz >>>>> >>>>> * dw2gencfi.c (dwcfi_seg_list): New struct. >>>>> (dwcfi_hash): New static hash variable. >>>>> (get_debugseg_name): New. >>>>> (alloc_debugseg_item): New. >>>>> (make_debug_seg): New. >>>>> (dwcfi_hash_insert): New. >>>>> (dwcfi_hash_find): New. >>>>> (dwcfi_hash_find_or_make): New. >>>>> (cfi_insn_data): New member cur_seg. >>>>> (cie_entry): Likewise. >>>>> (fde_entry): New cseg and handled members. >>>>> (alloc_fde_entry): Initialize cseg member. >>>>> (alloc_cfi_insn_data): Initialize cur_seg member. >>>>> (dot_cfi_sections): Compare for beginning of >>>>> section names via strncmp. >>>>> (get_cfi_seg): New. >>>>> (cfi_finish): Treat link-once sections. >>>>> (is_now_linkonce_segment): New local helper. >>>>> (output_cie): Ignore cie entries not member of current >>>>> segment. >>>>> (output_fde): Likewise. >>>>> (select_cie_for_fde): Likewise. >>>>> (cfi_change_reg_numbers): Add new argument for current segment >>>>> and ignore insn elements, if not part of current segment. >>>>> * ehopt.c (get_cie_info): Use strncmp for >>>>> section name matching. >>>>> (heck_eh_frame): Likewise. >=20 > dw2gencfi.c:1870:8: error: variable =E2=80=98cfi_seg=E2=80=99 set but not= used [-Werror=3Dunused-but-set-variable] > gcc-4.6.0-5.fc15.x86_64 >=20 > Could you please provide a fix? This fixes the breakage, but doesn't address the issue that it looks to me like there's an omitted call to md_fix_up_eh_frame() after the second invocation of get_cfi_seg(). gas/ChangeLog: * dw2gencfi.c (dwcfi_hash): Wrap in #ifdef md_fix_up_eh_frame. (get_debugseg_name): Likewise. (alloc_debugseg_item): Likewise. (make_debug_seg): Likewise. (dwcfi_hash_insert): Likewise. (dwcfi_hash_find): Likewise. (dwcfi_hash_find_or_make): Likewise. (get_cfi_seg): Likewise. (cfi_finish): Wrap references to cfi_seg and calls to get_cfi_seg() in #ifdef md_fix_up_eh_frame likewise. Verified that it fixes the build on i686-pc-cygwin and x86_64-unknown-linux-gnu, OK to install? cheers, DaveK Hmm, I see the issue that cfi_seg might be just set, but not used. This can= be fixed by simply adding - after setting of cfi_seg - an check for if (!c= fi_seg) abort ();. This check is superflous as cfi_seg never can be NULL, = but it silence this warning. The missing md_fix_up_eh_frame is used, as it was done in original code. He= re just on case (IIRC it is the debug_frame one) uses it. It might be nece= ssary to add it here for the "eh_frame" case too. But I don't see actual a = reason to add all this #ifdef guarding you do. Regards, Kai