diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-07-06 05:12:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-07-06 05:12:03 +0000 |
commit | 28a13fec147af8768d92f44d5d6e7ac10b918e82 (patch) | |
tree | 6aa54e944ccb66db5d5c7d29c51df579a8782a9b /gold/x86_64.cc | |
parent | 24d47b3460c983e3b01d8230a46b1ea19828bde1 (diff) | |
download | gdb-28a13fec147af8768d92f44d5d6e7ac10b918e82.zip gdb-28a13fec147af8768d92f44d5d6e7ac10b918e82.tar.gz gdb-28a13fec147af8768d92f44d5d6e7ac10b918e82.tar.bz2 |
PR gold/12392
* i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
symbols if necessary.
* x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r-- | gold/x86_64.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 8308bf4..adcfd42 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -2599,6 +2599,46 @@ Target_x86_64::do_finalize_sections( uint64_t data_size = this->got_plt_->current_data_size(); symtab->get_sized_symbol<64>(sym)->set_symsize(data_size); } + + if (parameters->doing_static_link() && this->plt_ == NULL) + { + // If linking statically, make sure that the __rela_iplt symbols + // were defined if necessary, even if we didn't create a PLT. + static const Define_symbol_in_segment syms[] = + { + { + "__rela_iplt_start", // name + elfcpp::PT_LOAD, // segment_type + elfcpp::PF_W, // segment_flags_set + elfcpp::PF(0), // segment_flags_clear + 0, // value + 0, // size + elfcpp::STT_NOTYPE, // type + elfcpp::STB_GLOBAL, // binding + elfcpp::STV_HIDDEN, // visibility + 0, // nonvis + Symbol::SEGMENT_START, // offset_from_base + true // only_if_ref + }, + { + "__rela_iplt_end", // name + elfcpp::PT_LOAD, // segment_type + elfcpp::PF_W, // segment_flags_set + elfcpp::PF(0), // segment_flags_clear + 0, // value + 0, // size + elfcpp::STT_NOTYPE, // type + elfcpp::STB_GLOBAL, // binding + elfcpp::STV_HIDDEN, // visibility + 0, // nonvis + Symbol::SEGMENT_START, // offset_from_base + true // only_if_ref + } + }; + + symtab->define_symbols(layout, 2, syms, + layout->script_options()->saw_sections_clause()); + } } // Perform a relocation. |