aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2010-02-09 20:29:44 +0000
committerDavid S. Miller <davem@redhat.com>2010-02-09 20:29:44 +0000
commit612a8d3dbf065f5fbaf7d9fe094a252ea6eb6c17 (patch)
tree4c383e3823597ab1d18e73ed5dd49a0539f07b4e /gold/layout.cc
parent684b268abacfb21ae5b35b2bb6d8fc24665e97d9 (diff)
downloadgdb-612a8d3dbf065f5fbaf7d9fe094a252ea6eb6c17.zip
gdb-612a8d3dbf065f5fbaf7d9fe094a252ea6eb6c17.tar.gz
gdb-612a8d3dbf065f5fbaf7d9fe094a252ea6eb6c17.tar.bz2
* output.h (Output_data_dynamic::add_section_size): New method
that takes two Output_data objects. (Output_data_dynamic::Dynamic_entry): Create storage for secondary entry param. Handle it in initializers. * output.cc (Output_data_dynamic::Dynamic_entry::write): For DYNAMIC_SECTION_SIZE, add in second object size if non-NULL. * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt arg. * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt, and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt * arm.cc (Target_arm::do_finalize_sections): Update to pass false for dynrel_includes_plt. * i386.cc (Target_i386::do_finalize_sections): Likewise. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise. * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output before .rela.plt (Target_sparc::do_finalize_sections): Update to pass true for dynrel_includes_plt. * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be output before .rela.plt (Target_powerpc::do_finalize_sections): Update to pass true for dynrel_includes_plt when 32-bit.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 52989a5..faa0c72 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -3240,7 +3240,7 @@ void
Layout::add_target_dynamic_tags(bool use_rel, const Output_data* plt_got,
const Output_data* plt_rel,
const Output_data_reloc_generic* dyn_rel,
- bool add_debug)
+ bool add_debug, bool dynrel_includes_plt)
{
Output_data_dynamic* odyn = this->dynamic_data_;
if (odyn == NULL)
@@ -3261,8 +3261,12 @@ Layout::add_target_dynamic_tags(bool use_rel, const Output_data* plt_got,
{
odyn->add_section_address(use_rel ? elfcpp::DT_REL : elfcpp::DT_RELA,
dyn_rel);
- odyn->add_section_size(use_rel ? elfcpp::DT_RELSZ : elfcpp::DT_RELASZ,
- dyn_rel);
+ if (plt_rel != NULL && dynrel_includes_plt)
+ odyn->add_section_size(use_rel ? elfcpp::DT_RELSZ : elfcpp::DT_RELASZ,
+ dyn_rel, plt_rel);
+ else
+ odyn->add_section_size(use_rel ? elfcpp::DT_RELSZ : elfcpp::DT_RELASZ,
+ dyn_rel);
const int size = parameters->target().get_size();
elfcpp::DT rel_tag;
int rel_size;