From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1943 invoked by alias); 5 May 2011 00:29:59 -0000 Received: (qmail 1935 invoked by uid 22791); 5 May 2011 00:29:58 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_WC X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 00:29:44 +0000 Received: by wyf19 with SMTP id 19so1552948wyf.0 for ; Wed, 04 May 2011 17:29:42 -0700 (PDT) Received: by 10.227.37.22 with SMTP id v22mr1819719wbd.27.1304555382578; Wed, 04 May 2011 17:29:42 -0700 (PDT) Received: from [192.168.2.99] (cpc2-cmbg8-0-0-cust61.5-4.cable.virginmedia.com [82.6.108.62]) by mx.google.com with ESMTPS id y29sm1025764wbd.21.2011.05.04.17.29.40 (version=SSLv3 cipher=OTHER); Wed, 04 May 2011 17:29:41 -0700 (PDT) Message-ID: <4DC1EF60.5050308@gmail.com> Date: Thu, 05 May 2011 00:29:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Jan Kratochvil CC: Kai Tietz , Nick Clifton , Kai Tietz , "H.J. Lu" , Binutils , Alan Modra Subject: Re: gas -Werror compilation break [Re: [patch ld bfd gas]: Handle linkonce for cfi generated debug_frame and eh_frame data] References: <4DB6E500.5030807@redhat.com> <20110427203457.GA12977@host1.jankratochvil.net> In-Reply-To: <20110427203457.GA12977@host1.jankratochvil.net> Content-Type: multipart/mixed; boundary="------------060906000207070409060305" 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/msg00056.txt.bz2 This is a multi-part message in MIME format. --------------060906000207070409060305 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-length: 2376 On 27/04/2011 21:34, Jan Kratochvil wrote: > Hi Kai, > > 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. > > dw2gencfi.c:1870:8: error: variable ‘cfi_seg’ set but not used [-Werror=unused-but-set-variable] > gcc-4.6.0-5.fc15.x86_64 > > 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 --------------060906000207070409060305 Content-Type: text/x-c; name="gas-werror.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gas-werror.diff" Content-length: 2811 Index: gas/dw2gencfi.c =================================================================== RCS file: /cvs/src/src/gas/dw2gencfi.c,v retrieving revision 1.52 diff -p -u -r1.52 dw2gencfi.c --- gas/dw2gencfi.c 26 Apr 2011 15:28:07 -0000 1.52 +++ gas/dw2gencfi.c 5 May 2011 00:18:58 -0000 @@ -86,6 +86,7 @@ struct dwcfi_seg_list #define FRAME_NAME ".eh_frame" +#ifdef md_fix_up_eh_frame static struct hash_control *dwcfi_hash; /* Build based on segment the derived .debug_... @@ -137,6 +138,7 @@ alloc_debugseg_item (segT seg, int subse r->seg_name = name; return r; } +#endif static segT is_now_linkonce_segment (void) @@ -151,6 +153,7 @@ is_now_linkonce_segment (void) return NULL; } +#ifdef md_fix_up_eh_frame /* Generate debug... segment with same linkonce properties of based segment. */ @@ -227,6 +230,7 @@ dwcfi_hash_find_or_make (segT cseg, cons return item; } +#endif /* ??? Share this with dwarf2cfg.c. */ #ifndef TC_DWARF2_EMIT_OFFSET @@ -1851,6 +1855,7 @@ cfi_change_reg_numbers (struct cfi_insn_ #define cfi_change_reg_numbers(insn, cseg) do { } while (0) #endif +#ifdef md_fix_up_eh_frame static segT get_cfi_seg (segT cseg, const char *base, flagword flags, int align) { @@ -1862,12 +1867,16 @@ get_cfi_seg (segT cseg, const char *base record_alignment (l->seg, align); return l->seg; } +#endif void cfi_finish (void) { struct cie_entry *cie, *cie_next; - segT cfi_seg, ccseg; +#ifdef md_fix_up_eh_frame + segT cfi_seg; +#endif + segT ccseg; struct fde_entry *fde; struct cfi_insn_data *first; int save_flag_traditional_format, seek_next_seg; @@ -1884,7 +1893,9 @@ cfi_finish (void) do { ccseg = NULL; +#ifdef md_fix_up_eh_frame cfi_seg = NULL; +#endif seek_next_seg = 0; for (cie = cie_root; cie; cie = cie_next) { @@ -1905,12 +1916,12 @@ cfi_finish (void) if (!seek_next_seg) { ccseg = fde->cseg; +#ifdef md_fix_up_eh_frame /* Open .eh_frame section. */ cfi_seg = get_cfi_seg (ccseg, ".eh_frame", SEC_ALLOC | SEC_LOAD | SEC_DATA | DWARF2_EH_FRAME_READ_ONLY, EH_FRAME_ALIGNMENT); -#ifdef md_fix_up_eh_frame md_fix_up_eh_frame (cfi_seg); #endif seek_next_seg = 1; @@ -1943,7 +1954,9 @@ cfi_finish (void) do { ccseg = NULL; +#ifdef md_fix_up_eh_frame cfi_seg = NULL; +#endif seek_next_seg = 0; for (cie = cie_root; cie; cie = cie_next) { @@ -1964,10 +1977,12 @@ cfi_finish (void) if (!seek_next_seg) { ccseg = fde->cseg; +#ifdef md_fix_up_eh_frame /* Open .debug_frame section. */ cfi_seg = get_cfi_seg (ccseg, ".debug_frame", SEC_READONLY | SEC_DEBUGGING, alignment); +#endif seek_next_seg = 1; } fde->handled = 1; --------------060906000207070409060305--