aboutsummaryrefslogtreecommitdiff
path: root/gold/powerpc.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/powerpc.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/powerpc.cc')
-rw-r--r--gold/powerpc.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 83bb992..cc46782 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -948,6 +948,11 @@ Target_powerpc<size, big_endian>::make_plt_entry(Symbol_table* symtab,
// Create the GOT section first.
this->got_section(symtab, layout);
+ // Ensure that .rela.dyn always appears before .rela.plt This is
+ // necessary due to how, on PowerPC and some other targets, .rela.dyn
+ // needs to include .rela.plt in it's range.
+ this->rela_dyn_section(layout);
+
this->plt_ = new Output_data_plt_powerpc<size, big_endian>(layout);
layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
(elfcpp::SHF_ALLOC
@@ -1556,7 +1561,7 @@ Target_powerpc<size, big_endian>::do_finalize_sections(
? NULL
: this->plt_->rel_plt());
layout->add_target_dynamic_tags(false, this->plt_, rel_plt,
- this->rela_dyn_, true);
+ this->rela_dyn_, true, size == 32);
// Emit any relocs we saved in an attempt to avoid generating COPY
// relocs.