diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-01-07 21:09:31 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-01-07 21:09:31 +0000 |
commit | 3a44184e641a1a7f6791b65fed802492032d8492 (patch) | |
tree | 5025d8c7aa99dc8b416e78f4cf046771e937c76d /gold/layout.cc | |
parent | 71a72a84624232e06f41b605ac5a3e277f28a0dc (diff) | |
download | gdb-3a44184e641a1a7f6791b65fed802492032d8492.zip gdb-3a44184e641a1a7f6791b65fed802492032d8492.tar.gz gdb-3a44184e641a1a7f6791b65fed802492032d8492.tar.bz2 |
PR 11061
* output.h (class Output_reloc) [SHT_RELA]: Add is_relative
function.
(class Output_data_reloc_generic): Define.
(class Output_data_reloc_base): Change base class to
Output_data_reloc_generic. Change add() method to call
bump_relative_reloc_count for a relative reloc. Remove
sort_relocs_ field.
* output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
to sort_relocs().
* layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
appropriate.
* layout.h (class Layout): Update declaration.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r-- | gold/layout.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc index a55020c..dc7cd13 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -3226,7 +3226,8 @@ Layout::create_interp(const Target* target) void Layout::add_target_dynamic_tags(bool use_rel, const Output_data* plt_got, const Output_data* plt_rel, - const Output_data* dyn_rel, bool add_debug) + const Output_data_reloc_generic* dyn_rel, + bool add_debug) { Output_data_dynamic* odyn = this->dynamic_data_; if (odyn == NULL) @@ -3273,6 +3274,16 @@ Layout::add_target_dynamic_tags(bool use_rel, const Output_data* plt_got, gold_unreachable(); } odyn->add_constant(rel_tag, rel_size); + + if (parameters->options().combreloc()) + { + size_t c = dyn_rel->relative_reloc_count(); + if (c > 0) + odyn->add_constant((use_rel + ? elfcpp::DT_RELCOUNT + : elfcpp::DT_RELACOUNT), + c); + } } if (add_debug && !parameters->options().shared()) |