2013-10-11 Roland McGrath <mcgrathr@google.com>
+ * target.h (Target::adjust_elf_header, Target::do_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.
+ * output.h (Output_file_header): Remove const from member target_
+ and corresponding constructor argument.
+ * output.cc (Output_file_header::Output_file_header): Update prototype.
+ (Output_file_header::do_sized_write): Use this->target_ in place
+ of parameters()->target().
+
* testsuite/undef_symbol.cc (Foo::get_a): New method.
* configure.ac (MERGE_CONSTANTS_FLAG): New check.
// Output_file_header methods.
-Output_file_header::Output_file_header(const Target* target,
+Output_file_header::Output_file_header(Target* target,
const Symbol_table* symtab,
const Output_segment_headers* osh)
: target_(target),
// Let the target adjust the ELF header, e.g., to set EI_OSABI in
// the e_ident field.
- parameters->target().adjust_elf_header(view, ehdr_size);
+ this->target_->adjust_elf_header(view, ehdr_size);
of->write_output_view(0, ehdr_size, view);
}
class Output_file_header : public Output_data
{
public:
- Output_file_header(const Target*,
+ Output_file_header(Target*,
const Symbol_table*,
const Output_segment_headers*);
off_t
do_size() const;
- const Target* target_;
+ Target* target_;
const Symbol_table* symtab_;
const Output_segment_headers* segment_header_;
const Output_section_headers* section_header_;
const elfcpp::Ehdr<size, big_endian>& ehdr);
void
- do_adjust_elf_header(unsigned char* view, int len) const;
+ do_adjust_elf_header(unsigned char* view, int len);
private:
void
Target_sparc<size, big_endian>::do_adjust_elf_header(
unsigned char* view,
- int len) const
+ int len)
{
elfcpp::Ehdr_write<size, big_endian> oehdr(view);
// 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 <dougkwan@google.com>.
// This file is part of gold.
template<int size, bool big_endian>
void
Sized_target<size, big_endian>::do_adjust_elf_header(unsigned char* view,
- int len) const
+ int len)
{
elfcpp::ELFOSABI osabi = this->osabi();
if (osabi != elfcpp::ELFOSABI_NONE)
// 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 <iant@google.com>.
// 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.
// 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
// 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