From 83896202bf93a490c4b8e6a222903d5797e16b32 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 19 Dec 2011 21:07:16 +0000 Subject: * object.h (Relobj::local_symbol_value): New function. (Relobj::local_plt_offset): New function. (Relobj::local_has_got_offset): New function. (Relobj::local_got_offset): New function. (Relobj::set_local_got_offset): New function. (Relobj::do_local_symbol_value): New pure virtual function. (Relobj::do_local_plt_offset): Likewise. (Relobj::do_local_has_got_offset): Likewise. (Relobj::do_local_got_offset): Likewise. (Relobj::do_set_local_got_offset): Likewise. (Sized_relobj::do_local_has_got_offset): Rename from local_has_got_offset. (Sized_relobj::do_local_got_offset): Rename from local_got_offset. (Sized_relobj::do_set_local_got_offset): Rename from set_local_got_offset. (Sized_relobj_file::do_local_plt_offset): Rename from local_plt_offset. (Sized_relobj_file::do_local_symbol_value): New function. * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from local_plt_offset. * output.cc (Output_data_got::Got_entry::write): Change object to Relobj. Use local_symbol_value. (Output_data_got::add_global_with_rel): Change rel_dyn to Output_data_reloc_generic*. Use add_global_generic. (Output_data_got::add_global_with_rela): Remove. Change all callers to use add_global_with_rel. (Output_data_got::add_global_pair_with_rel): Change rel_dyn to Output_data_reloc_generic*. Use add_global_generic. (Output_data_got::add_global_pair_with_rela): Remove. Change all callers to use add_global_pair_with_rel. (Output_data_got::add_local): Change object to Relobj*. (Output_data_got::add_local_plt): Likewise. (Output_data_got::add_local_with_rel): Change object to Relobj*, change rel_dyn to Output_data_reloc_generic*. Use add_local_generic. (Output_data_got::add_local_with_rela): Remove. Change all callers to use all_local_with_rel. (Output_data_got::add_local_pair_with_rel): Change object to Relobj*, change rel_dyn to Output_data_reloc_generic*. Use add_output_section_generic. (Output_data_got::add_local_pair_with_rela): Remove. Change all callers to use add_local_pair_with_rel. (Output_data_got::reserve_local): Change object to Relobj*. * output.h: (class Output_data_reloc_generic): Add pure virtual declarations for add_global_generic, add_local_generic, add_output_section_generic. (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new functions for Output_data_reloc_generic. Update declarations for changes listed in output.cc. (class Output_data_got): Change template parameter to got_size. Don't define Rel_dyn or Rela_dyn. Update declarations per above. * incremental.h (Sized_relobj_incr::do_local_symbol_value): New function. (Sized_relobj_incr::do_local_plt_offset): New function. * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call add_global_generic. --- gold/x86_64.cc | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'gold/x86_64.cc') diff --git a/gold/x86_64.cc b/gold/x86_64.cc index e7c981b..552e9d1 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -2137,11 +2137,11 @@ Target_x86_64::Scan::local(Symbol_table* symtab, object->error(_("local symbol %u has bad shndx %u"), r_sym, shndx); else - got->add_local_pair_with_rela(object, r_sym, - shndx, - GOT_TYPE_TLS_PAIR, - target->rela_dyn_section(layout), - elfcpp::R_X86_64_DTPMOD64, 0); + got->add_local_pair_with_rel(object, r_sym, + shndx, + GOT_TYPE_TLS_PAIR, + target->rela_dyn_section(layout), + elfcpp::R_X86_64_DTPMOD64, 0); } else if (optimized_type != tls::TLSOPT_TO_LE) unsupported_reloc_local(object, r_type); @@ -2207,9 +2207,9 @@ Target_x86_64::Scan::local(Symbol_table* symtab, Output_data_got<64, false>* got = target->got_section(symtab, layout); unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info()); - got->add_local_with_rela(object, r_sym, GOT_TYPE_TLS_OFFSET, - target->rela_dyn_section(layout), - elfcpp::R_X86_64_TPOFF64); + got->add_local_with_rel(object, r_sym, GOT_TYPE_TLS_OFFSET, + target->rela_dyn_section(layout), + elfcpp::R_X86_64_TPOFF64); } else if (optimized_type != tls::TLSOPT_TO_LE) unsupported_reloc_local(object, r_type); @@ -2481,8 +2481,8 @@ Target_x86_64::Scan::global(Symbol_table* symtab, && parameters->options().shared()) || (gsym->type() == elfcpp::STT_GNU_IFUNC && parameters->options().output_is_position_independent())) - got->add_global_with_rela(gsym, GOT_TYPE_STANDARD, rela_dyn, - elfcpp::R_X86_64_GLOB_DAT); + got->add_global_with_rel(gsym, GOT_TYPE_STANDARD, rela_dyn, + elfcpp::R_X86_64_GLOB_DAT); else { // For a STT_GNU_IFUNC symbol we want to write the PLT @@ -2580,19 +2580,19 @@ Target_x86_64::Scan::global(Symbol_table* symtab, // dtv-relative offset. Output_data_got<64, false>* got = target->got_section(symtab, layout); - got->add_global_pair_with_rela(gsym, GOT_TYPE_TLS_PAIR, - target->rela_dyn_section(layout), - elfcpp::R_X86_64_DTPMOD64, - elfcpp::R_X86_64_DTPOFF64); + got->add_global_pair_with_rel(gsym, GOT_TYPE_TLS_PAIR, + target->rela_dyn_section(layout), + elfcpp::R_X86_64_DTPMOD64, + elfcpp::R_X86_64_DTPOFF64); } else if (optimized_type == tls::TLSOPT_TO_IE) { // Create a GOT entry for the tp-relative offset. Output_data_got<64, false>* got = target->got_section(symtab, layout); - got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET, - target->rela_dyn_section(layout), - elfcpp::R_X86_64_TPOFF64); + got->add_global_with_rel(gsym, GOT_TYPE_TLS_OFFSET, + target->rela_dyn_section(layout), + elfcpp::R_X86_64_TPOFF64); } else if (optimized_type != tls::TLSOPT_TO_LE) unsupported_reloc_global(object, r_type, gsym); @@ -2613,17 +2613,17 @@ Target_x86_64::Scan::global(Symbol_table* symtab, target->got_section(symtab, layout); Output_data_got<64, false>* got = target->got_tlsdesc_section(); Reloc_section* rt = target->rela_tlsdesc_section(layout); - got->add_global_pair_with_rela(gsym, GOT_TYPE_TLS_DESC, rt, - elfcpp::R_X86_64_TLSDESC, 0); + got->add_global_pair_with_rel(gsym, GOT_TYPE_TLS_DESC, rt, + elfcpp::R_X86_64_TLSDESC, 0); } else if (optimized_type == tls::TLSOPT_TO_IE) { // Create a GOT entry for the tp-relative offset. Output_data_got<64, false>* got = target->got_section(symtab, layout); - got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET, - target->rela_dyn_section(layout), - elfcpp::R_X86_64_TPOFF64); + got->add_global_with_rel(gsym, GOT_TYPE_TLS_OFFSET, + target->rela_dyn_section(layout), + elfcpp::R_X86_64_TPOFF64); } else if (optimized_type != tls::TLSOPT_TO_LE) unsupported_reloc_global(object, r_type, gsym); @@ -2653,9 +2653,9 @@ Target_x86_64::Scan::global(Symbol_table* symtab, // Create a GOT entry for the tp-relative offset. Output_data_got<64, false>* got = target->got_section(symtab, layout); - got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET, - target->rela_dyn_section(layout), - elfcpp::R_X86_64_TPOFF64); + got->add_global_with_rel(gsym, GOT_TYPE_TLS_OFFSET, + target->rela_dyn_section(layout), + elfcpp::R_X86_64_TPOFF64); } else if (optimized_type != tls::TLSOPT_TO_LE) unsupported_reloc_global(object, r_type, gsym); -- cgit v1.1