From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8086 invoked by alias); 2 Apr 2014 06:54:53 -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 8075 invoked by uid 89); 2 Apr 2014 06:54:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f177.google.com Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 02 Apr 2014 06:54:51 +0000 Received: by mail-pd0-f177.google.com with SMTP id y10so10573644pdj.8 for ; Tue, 01 Apr 2014 23:54:50 -0700 (PDT) X-Received: by 10.68.196.202 with SMTP id io10mr7972707pbc.149.1396421689974; Tue, 01 Apr 2014 23:54:49 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPSA id el14sm5232264pac.31.2014.04.01.23.54.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 23:54:49 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 1DDA2EA00E4; Wed, 2 Apr 2014 17:24:44 +1030 (CST) Date: Wed, 02 Apr 2014 06:54:00 -0000 From: Alan Modra To: Sriraman Tallam Cc: binutils , Ian Lance Taylor Subject: Re: ICF on PowerPC Bug Message-ID: <20140402065443.GA18201@bubble.grove.modra.org> Mail-Followup-To: Sriraman Tallam , binutils , Ian Lance Taylor References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00014.txt.bz2 On Tue, Apr 01, 2014 at 03:06:37PM -0700, Sriraman Tallam wrote: > because fold2 is folded onto fold1. The only way to differentiate > fold1 and fold2 which have the same object code is via the relocation > type and the Info value is different. However, with powerpc this is > rewritten here in icf.cc: > > // Look through function descriptors > parameters->target().function_location(&loc); > if (loc.shndx != it_v->second) > { > it_v->second = loc.shndx; > // Modify symvalue/addend to the code entry. > it_a->first = loc.offset; > it_a->second = 0; > } > > I am not sure how to fix it. The following patch fixes the problem, but did you really mean to copy all the vectors here? Icf::Sections_reachable_info v = (it_reloc_info_list->second).section_info; // Stores the information of the symbol pointed to by the reloc. Icf::Symbol_info s = (it_reloc_info_list->second).symbol_info; // Stores the addend and the symbol value. Icf::Addend_info a = (it_reloc_info_list->second).addend_info; // Stores the offset of the reloc. Icf::Offset_info o = (it_reloc_info_list->second).offset_info; Icf::Reloc_addend_size_info reloc_addend_size_info = (it_reloc_info_list->second).reloc_addend_size_info; diff --git a/gold/icf.cc b/gold/icf.cc index f30eb41..920514c 100644 --- a/gold/icf.cc +++ b/gold/icf.cc @@ -288,8 +288,7 @@ get_section_contents(bool first_iteration, for (; it_v != v.end(); ++it_v, ++it_s, ++it_a, ++it_o, ++it_addend_size) { - if (first_iteration - && it_v->first != NULL) + if (it_v->first != NULL) { Symbol_location loc; loc.object = it_v->first; -- Alan Modra Australia Development Lab, IBM