diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:17:57 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:17:57 +0800 |
commit | fd6fc0c5f6ec26b3b526655a721b7b0af0b14644 (patch) | |
tree | 487c69cb82b68612b53ad40569a54e060973eca2 /binutils-2.25/gold/object.cc | |
parent | aff326d7fffe9111be0900d433c6de6661c48af3 (diff) | |
download | toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.zip toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.tar.gz toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.tar.bz2 |
Update binutils-2.25/gold to ToT
commit be66981e1605eff305ac9c561825f4bd6801fca2
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Feb 22 05:18:50 2015 -0800
Set GOLD_DEFAULT_SIZE to 32 for x32
* configure.ac (default_size): Set to 32 for x32.
* configure: Regenerated.
Change-Id: I4b2d8927e4e41cf2fac3c92d00e8aef69b5ce21f
Diffstat (limited to 'binutils-2.25/gold/object.cc')
-rw-r--r-- | binutils-2.25/gold/object.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/binutils-2.25/gold/object.cc b/binutils-2.25/gold/object.cc index 6ab84ce..c90b67e 100644 --- a/binutils-2.25/gold/object.cc +++ b/binutils-2.25/gold/object.cc @@ -1,6 +1,6 @@ // object.cc -- support for an object file for linking in gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. // This file is part of gold. @@ -430,6 +430,7 @@ Sized_relobj_file<size, big_endian>::Sized_relobj_file( kept_comdat_sections_(), has_eh_frame_(false), discarded_eh_frame_shndx_(-1U), + is_deferred_layout_(false), deferred_layout_(), deferred_layout_relocs_(), compressed_sections_() @@ -1430,6 +1431,7 @@ Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab, { parameters->options().plugins()->add_deferred_layout_object(this); this->deferred_layout_.reserve(num_sections_to_defer); + this->is_deferred_layout_ = true; } // Whether we've seen a .note.GNU-stack section. @@ -1590,10 +1592,13 @@ Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab, { if (is_pass_one) { - out_sections[i] = reinterpret_cast<Output_section*>(1); + if (this->is_deferred_layout()) + out_sections[i] = reinterpret_cast<Output_section*>(2); + else + out_sections[i] = reinterpret_cast<Output_section*>(1); out_section_offsets[i] = invalid_address; } - else if (should_defer_layout) + else if (this->is_deferred_layout()) this->deferred_layout_.push_back(Deferred_layout(i, name, pshdrs, reloc_shndx[i], @@ -1658,11 +1663,12 @@ Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab, } // Defer layout here if input files are claimed by plugins. When gc - // is turned on this function is called twice. For the second call - // should_defer_layout should be false. - if (should_defer_layout && (shdr.get_sh_flags() & elfcpp::SHF_ALLOC)) + // is turned on this function is called twice; we only want to do this + // on the first pass. + if (!is_pass_two + && this->is_deferred_layout() + && (shdr.get_sh_flags() & elfcpp::SHF_ALLOC)) { - gold_assert(!is_pass_two); this->deferred_layout_.push_back(Deferred_layout(i, name, pshdrs, reloc_shndx[i], @@ -1764,6 +1770,8 @@ Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab, Output_section* data_section = out_sections[data_shndx]; if (data_section == reinterpret_cast<Output_section*>(2)) { + if (is_pass_two) + continue; // The layout for the data section was deferred, so we need // to defer the relocation section, too. const char* name = pnames + shdr.get_sh_name(); @@ -2581,7 +2589,7 @@ Sized_relobj_file<size, big_endian>::write_local_symbols( dyn_oview = of->get_output_view(this->local_dynsym_offset_, dyn_output_size); - const Output_sections out_sections(this->output_sections()); + const Output_sections& out_sections(this->output_sections()); gold_assert(this->local_values_.size() == loccount); |