From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68445 invoked by alias); 21 Mar 2015 19:08:42 -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 68434 invoked by uid 89); 21 Mar 2015 19:08:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-qc0-f176.google.com Received: from mail-qc0-f176.google.com (HELO mail-qc0-f176.google.com) (209.85.216.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 21 Mar 2015 19:08:41 +0000 Received: by qcay5 with SMTP id y5so27686443qca.1 for ; Sat, 21 Mar 2015 12:08:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wxIosR6zZCUzhNlOJ+59h2MoEY+iX8IzzHN1q7kpTng=; b=G6/Ri/PFhZS5V4khkEMxqC7GgwbU2+WDNxx1Cbg4lVi5DlkUc6WhsXfAiF1BIjuuDH gLf2RBr6SNngqTEd+7qblWl2TeHsRltqEc5MTCxeFEUx1iqsSxXcytZsEct82MEKJQ3H CwjfAd9U7zc/LlRNq3f7Y+m9BYNHnQcbZ+Nfe0l99+3eN+KXTW+65XCzPHuct9kzeKVq 0z+RLgUaxZgE4D02sDTxE3Bb1q5n755UIHrYipLeL6+FSSUgsYWozWQspayXNe5DQH5l dcpf2f2DydNBvCOsRt7Vab/iSX9LqwhKEhBzBSqqsw9OqO5MhRa3a62f+bVzBVkZy4jJ 7MMw== X-Gm-Message-State: ALoCoQmfcy33jpW2Cp8dH2ICqoKqeVPQ9lGR58w0h+WGGB82rwlY+E88/mvVcnAUSVxkdfNXFCEm MIME-Version: 1.0 X-Received: by 10.140.129.65 with SMTP id 62mr112180177qhb.11.1426964918889; Sat, 21 Mar 2015 12:08:38 -0700 (PDT) Received: by 10.140.99.105 with HTTP; Sat, 21 Mar 2015 12:08:38 -0700 (PDT) In-Reply-To: References: Date: Sat, 21 Mar 2015 19:08:00 -0000 Message-ID: Subject: Re: [patch] Remove is_merge_section_for From: Cary Coutant To: =?UTF-8?Q?Rafael_Esp=C3=ADndola?= Cc: Binutils Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00268.txt.bz2 > Now that Input_merge_map has an Output_section_data, we can use it in > implementing find_merge_section and replace the only use of > is_merge_section_for with it. @@ -151,6 +150,11 @@ class Object_merge_map Input_merge_map* get_input_merge_map(unsigned int shndx); + const Input_merge_map* + get_input_merge_map(unsigned int shndx) const { + return const_cast(this)->get_input_merge_map(shndx); + } When you need both const and non-const versions of a method, have the non-const version call the const version, instead of the other way around. +// Build the lookup maps for relaxed sections. This is needs // to be declared as a const methods so that it is callable with a const s/is needs/needs/ s/as a const methods/as a const method/ + const Output_section_data* data = this->find_merge_section(object, shndx); + if (!data) I prefer "if (data == NULL)". This is OK, with a ChangeLog entry and those fixes. Thanks! -cary