From 9e9e071b2e0501d3413f48030f0f0edb0131305a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 6 Mar 2010 02:34:13 +0000 Subject: * options.h (class General_options): Add --spare-dynamic-tags. * output.cc (Output_data_dynamic::set_final_data_size): Implement --spare-dynamic-tags. --- gold/output.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gold/output.cc') 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) -- cgit v1.1