summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/gold/merge.cc
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2015-02-24 18:17:57 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-02-24 18:17:57 +0800
commitfd6fc0c5f6ec26b3b526655a721b7b0af0b14644 (patch)
tree487c69cb82b68612b53ad40569a54e060973eca2 /binutils-2.25/gold/merge.cc
parentaff326d7fffe9111be0900d433c6de6661c48af3 (diff)
downloadtoolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.tar.gz
toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.tar.bz2
toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.zip
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/merge.cc')
-rw-r--r--binutils-2.25/gold/merge.cc30
1 files changed, 8 insertions, 22 deletions
diff --git a/binutils-2.25/gold/merge.cc b/binutils-2.25/gold/merge.cc
index 6d444e6c..bf004818 100644
--- a/binutils-2.25/gold/merge.cc
+++ b/binutils-2.25/gold/merge.cc
@@ -1,6 +1,6 @@
// merge.cc -- handle section merging for 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.
@@ -162,15 +162,12 @@ Object_merge_map::get_output_offset(const Merge_map* merge_map,
Input_merge_entry entry;
entry.input_offset = input_offset;
std::vector<Input_merge_entry>::const_iterator p =
- std::lower_bound(map->entries.begin(), map->entries.end(),
+ std::upper_bound(map->entries.begin(), map->entries.end(),
entry, Input_merge_compare());
- if (p == map->entries.end() || p->input_offset > input_offset)
- {
- if (p == map->entries.begin())
- return false;
- --p;
- gold_assert(p->input_offset <= input_offset);
- }
+ if (p == map->entries.begin())
+ return false;
+ --p;
+ gold_assert(p->input_offset <= input_offset);
if (input_offset - p->input_offset
>= static_cast<section_offset_type>(p->length))
@@ -564,9 +561,9 @@ Output_merge_string<Char_type>::do_add_input_section(Relobj* object,
& (this->addralign() - 1));
bool has_misaligned_strings = false;
- while (p < pend0)
+ while (p < pend)
{
- size_t len = string_length(p);
+ size_t len = p < pend0 ? string_length(p) : pend - p;
// Within merge input section each string must be aligned.
if (len != 0
@@ -581,17 +578,6 @@ Output_merge_string<Char_type>::do_add_input_section(Relobj* object,
p += len + 1;
i += (len + 1) * sizeof(Char_type);
}
- if (p < pend)
- {
- size_t len = pend - p;
-
- Stringpool::Key key;
- this->stringpool_.add_with_length(p, len, true, &key);
-
- merged_strings.push_back(Merged_string(i, key));
-
- i += (len + 1) * sizeof(Char_type);
- }
// Record the last offset in the input section so that we can
// compute the length of the last string.