aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-03-06 02:34:13 +0000
committerIan Lance Taylor <ian@airs.com>2010-03-06 02:34:13 +0000
commit9e9e071b2e0501d3413f48030f0f0edb0131305a (patch)
treeb397dca9925ab979588440c4f91539ae0b9ec3b6 /gold
parentbce522a2604ef89eceb4c7b7987a30e3d6c58825 (diff)
downloadgdb-9e9e071b2e0501d3413f48030f0f0edb0131305a.zip
gdb-9e9e071b2e0501d3413f48030f0f0edb0131305a.tar.gz
gdb-9e9e071b2e0501d3413f48030f0f0edb0131305a.tar.bz2
* options.h (class General_options): Add --spare-dynamic-tags.
* output.cc (Output_data_dynamic::set_final_data_size): Implement --spare-dynamic-tags.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/options.h4
-rw-r--r--gold/output.cc10
3 files changed, 17 insertions, 3 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index b632096..1ae668b 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,11 @@
2010-03-05 Ian Lance Taylor <iant@google.com>
+ * options.h (class General_options): Add --spare-dynamic-tags.
+ * output.cc (Output_data_dynamic::set_final_data_size): Implement
+ --spare-dynamic-tags.
+
+2010-03-05 Ian Lance Taylor <iant@google.com>
+
* incremental.cc: Include "libiberty.h".
2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
diff --git a/gold/options.h b/gold/options.h
index fee76dc..7f35bd2 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -875,6 +875,10 @@ class General_options
N_("Sort common symbols by alignment"),
N_("[={ascending,descending}]"));
+ DEFINE_uint(spare_dynamic_tags, options::TWO_DASHES, '\0', 5,
+ N_("Dynamic tag slots to reserve (default 5)"),
+ N_("COUNT"));
+
DEFINE_bool(strip_all, options::TWO_DASHES, 's', false,
N_("Strip all symbols"), NULL);
DEFINE_bool(strip_debug, options::TWO_DASHES, 'S', false,
diff --git a/gold/output.cc b/gold/output.cc
index d49f08b..0627cbe 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1622,9 +1622,13 @@ Output_data_dynamic::set_final_data_size()
{
// Add the terminating entry if it hasn't been added.
// Because of relaxation, we can run this multiple times.
- if (this->entries_.empty()
- || this->entries_.rbegin()->tag() != elfcpp::DT_NULL)
- this->add_constant(elfcpp::DT_NULL, 0);
+ if (this->entries_.empty() || this->entries_.back().tag() != elfcpp::DT_NULL)
+ {
+ int extra = parameters->options().spare_dynamic_tags();
+ for (int i = 0; i < extra; ++i)
+ this->add_constant(elfcpp::DT_NULL, 0);
+ this->add_constant(elfcpp::DT_NULL, 0);
+ }
int dyn_size;
if (parameters->target().get_size() == 32)