From patchwork Thu May 24 22:03:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 161229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7DDACB6F77 for ; Fri, 25 May 2012 08:03:38 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1338501818; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=1UkHv8OiVUCwYOEYc/QWe8baVTs=; b=PxlO7hiuZvfsXbs q+z9wUNTidSDwgNgAhgTuJ62N+Y4qK5aanjFAcOgxGen/ysD1hfwggPomI7WK3N8 6XxfyB7H9NDecZ10x6WPcn9Dcupg1+5vIwidTSGDEApZCwYH7ksgGxki9ebZwO5l C6sG/rfpBCoNGSYgTDy8aE09Gbx8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=F6HO1nxTeI2CR9ExGLCzbE04UR8PvNWIjxiz5V3nsYSuRW3bDSqCOqDglbvAA2 9ci3mt9yRnW0rEBqulsA8NaWZiytKVCW9re6BB+eICKOpqOb4Bxy+yPKW1VoyWSW mDzDY64eWktfS+UzTUtm8I31neMu8a/YzM9Lo5llXm0x0=; Received: (qmail 8344 invoked by alias); 24 May 2012 22:03:35 -0000 Received: (qmail 8336 invoked by uid 22791); 24 May 2012 22:03:34 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_BJ, TW_JC X-Spam-Check-By: sourceware.org Received: from mail-qc0-f175.google.com (HELO mail-qc0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 May 2012 22:03:22 +0000 Received: by qcso7 with SMTP id o7so258204qcs.20 for ; Thu, 24 May 2012 15:03:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.33.8 with SMTP id f8mr4088601qad.11.1337897001154; Thu, 24 May 2012 15:03:21 -0700 (PDT) Received: by 10.229.169.130 with HTTP; Thu, 24 May 2012 15:03:21 -0700 (PDT) In-Reply-To: <20120524214340.GS16117@tyan-ft48-01.lab.bos.redhat.com> References: <20120524140119.GA27160@intel.com> <4FBE472E.1040202@gnu.org> <20120524214340.GS16117@tyan-ft48-01.lab.bos.redhat.com> Date: Thu, 24 May 2012 15:03:21 -0700 Message-ID: Subject: Re: PATCH: PR bootstrap/53472: contrib/compare-debug should strip out .comment section From: "H.J. Lu" To: Jakub Jelinek Cc: Paolo Bonzini , gcc-patches@gcc.gnu.org, Richard Guenther X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, May 24, 2012 at 2:43 PM, Jakub Jelinek wrote: > On Thu, May 24, 2012 at 02:32:59PM -0700, H.J. Lu wrote: >> This patch works on openSUSE 12.1.  OK to install? > > Can't you do that only if the first cmp failed? > In that case strip and cmp again... > Like this? OK to install? Thanks. diff --git a/contrib/compare-debug b/contrib/compare-debug index 010d17f..fb8986d 100755 --- a/contrib/compare-debug +++ b/contrib/compare-debug @@ -73,11 +73,35 @@ Darwin) ;; esac +remove_comment () +{ + file=$1 + opts= + for s in `objdump --section-headers "$file" | awk '{ print $2 }'`; do + case "$s" in + .comment*) + opts="$opts --remove-section $s" + ;; + esac + done + [ -n "$opts" ] && objcopy $opts $file +} + if cmp "$1.$suf1" "$2.$suf2"; then status=0 else status=1 + # Remove any .comment sections. + if (objcopy -v) 2>&1 | grep ' --remove-section' > /dev/null \ + && (objdump --help) 2>&1 | grep ' --\[*section-\]*headers' > /dev/null; then + remove_comment "$1.$suf1" + remove_comment "$2.$suf2" + if cmp "$1.$suf1" "$2.$suf2"; then + status=0 + fi + fi + # Assembler-generated CFI will add an .eh_frame section for -g not # present in -g0. Try to cope with it by checking that an .eh_frame