From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7975 invoked by alias); 11 Oct 2013 18:46:57 -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 7957 invoked by uid 89); 11 Oct 2013 18:46:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f172.google.com Received: from mail-ie0-f172.google.com (HELO mail-ie0-f172.google.com) (209.85.223.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 11 Oct 2013 18:46:55 +0000 Received: by mail-ie0-f172.google.com with SMTP id x13so9366686ief.17 for ; Fri, 11 Oct 2013 11:46:53 -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:from:date:message-id:subject:to :content-type; bh=sNsHueO6yNtOrMOF0qd5I/dpqrih8xc9P1Us1gOi36k=; b=Bgjhq5BRGHvAfem674t0nufzpsYN5Kl3ZavD8yPFFDNYrY0NtccgZq7TtR8JZ/0b28 +ApIhZnjT3vjcVi9A/R+VMMCVCf84j3UQix4AsgyqtUuBIRCzDCRaJ//TI+Ic/lcqW0V 7kQoVim4FWsBrSZSyoPI0WXMEqG63MTGcvTOm+BIyHjJqz7OK2iF5wG+vloWRWEowjQ3 18GHwQqnGsmWcTAip7w2HPhw7iqKfwFoSrVUQJnr4KQiaRpxzktWpk2CXjAbBebrEG3d HuES923K0qbTz8aVYXs/iqqJN8/C7e8j/rd/Q7Bnj8GGu7NpitVESAfPCVIfzyAlUcQK imgA== X-Gm-Message-State: ALoCoQm26H4qiWHEVL+B+2gEEhAiFRX60DRztoTPEz8Sdd9ZXp2bq1RXRlKgytDd0Fqbw2jIdHRetRgBepbUC4oGWpkmC2reWcQeANPwZSFGArvw+zy1H9QfwXCexEjQmI0dHP2CnarH7NQlNyHftDJBD3Ds7IYAz7Y8OkDK8dGrPR98OLF8MYkXD1gaA5yF1w7HB+6gEaA3oNTv1F7g8alk1owiTFQiCQ== X-Received: by 10.50.25.39 with SMTP id z7mr3796224igf.59.1381517213208; Fri, 11 Oct 2013 11:46:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.11.68 with HTTP; Fri, 11 Oct 2013 11:46:32 -0700 (PDT) From: Roland McGrath Date: Fri, 11 Oct 2013 18:46:00 -0000 Message-ID: Subject: [PATCH] gold: remove false const from Target::do_adjust_elf_header To: "binutils@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-10/txt/msg00172.txt.bz2 The claim of constness is false for Target_arm (because it calls set_processor_specific_flags), so it should not be claimed for the general case. OK for trunk and 2.24? Thanks, Roland gold/ * target.h (Target::adjust_elf_header, Target::adjust_elf_header): Remove const from declaration. * target.cc (Sized_target::do_adjust_elf_header): Update definition. * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise. * parameters.h (Parameters::target): Make return value non-const. --- a/gold/parameters.h +++ b/gold/parameters.h @@ -99,7 +99,7 @@ class Parameters { return this->target_ != NULL; } // The target of the output file we are generating. - const Target& + Target& target() const { gold_assert(this->target_valid()); --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -217,7 +217,7 @@ class Target_sparc : public Sized_target const elfcpp::Ehdr& ehdr); void - do_adjust_elf_header(unsigned char* view, int len) const; + do_adjust_elf_header(unsigned char* view, int len); private: @@ -4341,7 +4341,7 @@ template void Target_sparc::do_adjust_elf_header( unsigned char* view, - int len) const + int len) { elfcpp::Ehdr_write oehdr(view); --- a/gold/target.cc +++ b/gold/target.cc @@ -1,6 +1,6 @@ // target.cc -- target support for gold. -// Copyright 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright 2009, 2010, 2011, 2013 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. @@ -219,7 +219,7 @@ Target::do_plt_fde_location(const Output_data* plt, unsigned char*, template void Sized_target::do_adjust_elf_header(unsigned char* view, - int len) const + int len) { elfcpp::ELFOSABI osabi = this->osabi(); if (osabi != elfcpp::ELFOSABI_NONE) --- a/gold/target.h +++ b/gold/target.h @@ -1,6 +1,6 @@ // target.h -- target support for gold -*- C++ -*- -// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 +// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 // Free Software Foundation, Inc. // Written by Ian Lance Taylor . @@ -238,7 +238,7 @@ class Target // Adjust the output file header before it is written out. VIEW // points to the header in external form. LEN is the length. void - adjust_elf_header(unsigned char* view, int len) const + adjust_elf_header(unsigned char* view, int len) { return this->do_adjust_elf_header(view, len); } // Return address and size to plug into eh_frame FDEs associated with a PLT. @@ -548,7 +548,7 @@ class Target // By default, we set the EI_OSABI field if requested (in // Sized_target). virtual void - do_adjust_elf_header(unsigned char*, int) const = 0; + do_adjust_elf_header(unsigned char*, int) = 0; // Return address and size to plug into eh_frame FDEs associated with a PLT. virtual void @@ -1018,7 +1018,7 @@ class Sized_target : public Target // Set the EI_OSABI field if requested. virtual void - do_adjust_elf_header(unsigned char*, int) const; + do_adjust_elf_header(unsigned char*, int); // Handle target specific gc actions when adding a gc reference. virtual void