aboutsummaryrefslogtreecommitdiff
path: root/gold/sparc.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-12-19 21:07:16 +0000
committerIan Lance Taylor <ian@airs.com>2011-12-19 21:07:16 +0000
commit83896202bf93a490c4b8e6a222903d5797e16b32 (patch)
treeaf1d1b5cc6a8a05f394c57bd27fbb5a69f912fde /gold/sparc.cc
parent984ac464433aa838ae9e305e216f0d084a8b550f (diff)
downloadgdb-83896202bf93a490c4b8e6a222903d5797e16b32.zip
gdb-83896202bf93a490c4b8e6a222903d5797e16b32.tar.gz
gdb-83896202bf93a490c4b8e6a222903d5797e16b32.tar.bz2
* 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.
Diffstat (limited to 'gold/sparc.cc')
-rw-r--r--gold/sparc.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/gold/sparc.cc b/gold/sparc.cc
index 12e1dee..39c7e7c 100644
--- a/gold/sparc.cc
+++ b/gold/sparc.cc
@@ -1998,14 +1998,14 @@ Target_sparc<size, big_endian>::Scan::local(
object->error(_("local symbol %u has bad shndx %u"),
r_sym, shndx);
else
- got->add_local_pair_with_rela(object, r_sym,
- lsym.get_st_shndx(),
- GOT_TYPE_TLS_PAIR,
- target->rela_dyn_section(layout),
- (size == 64
- ? elfcpp::R_SPARC_TLS_DTPMOD64
- : elfcpp::R_SPARC_TLS_DTPMOD32),
- 0);
+ got->add_local_pair_with_rel(object, r_sym,
+ lsym.get_st_shndx(),
+ GOT_TYPE_TLS_PAIR,
+ target->rela_dyn_section(layout),
+ (size == 64
+ ? elfcpp::R_SPARC_TLS_DTPMOD64
+ : elfcpp::R_SPARC_TLS_DTPMOD32),
+ 0);
if (r_type == elfcpp::R_SPARC_TLS_GD_CALL)
generate_tls_call(symtab, layout, target);
}
@@ -2339,8 +2339,8 @@ Target_sparc<size, big_endian>::Scan::global(
if (gsym->is_from_dynobj()
|| gsym->is_undefined()
|| gsym->is_preemptible())
- got->add_global_with_rela(gsym, GOT_TYPE_STANDARD, rela_dyn,
- elfcpp::R_SPARC_GLOB_DAT);
+ got->add_global_with_rel(gsym, GOT_TYPE_STANDARD, rela_dyn,
+ elfcpp::R_SPARC_GLOB_DAT);
else if (!gsym->has_got_offset(GOT_TYPE_STANDARD))
{
unsigned int off = got->add_constant(0);
@@ -2389,14 +2389,14 @@ Target_sparc<size, big_endian>::Scan::global(
// dtv-relative offset.
Output_data_got<size, big_endian>* got
= target->got_section(symtab, layout);
- got->add_global_pair_with_rela(gsym, GOT_TYPE_TLS_PAIR,
- target->rela_dyn_section(layout),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_DTPMOD64 :
- elfcpp::R_SPARC_TLS_DTPMOD32),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_DTPOFF64 :
- elfcpp::R_SPARC_TLS_DTPOFF32));
+ got->add_global_pair_with_rel(gsym, GOT_TYPE_TLS_PAIR,
+ target->rela_dyn_section(layout),
+ (size == 64
+ ? elfcpp::R_SPARC_TLS_DTPMOD64
+ : elfcpp::R_SPARC_TLS_DTPMOD32),
+ (size == 64
+ ? elfcpp::R_SPARC_TLS_DTPOFF64
+ : elfcpp::R_SPARC_TLS_DTPOFF32));
// Emit R_SPARC_WPLT30 against "__tls_get_addr"
if (r_type == elfcpp::R_SPARC_TLS_GD_CALL)
@@ -2407,11 +2407,11 @@ Target_sparc<size, big_endian>::Scan::global(
// Create a GOT entry for the tp-relative offset.
Output_data_got<size, big_endian>* got
= target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_TPOFF64 :
- elfcpp::R_SPARC_TLS_TPOFF32));
+ got->add_global_with_rel(gsym, GOT_TYPE_TLS_OFFSET,
+ target->rela_dyn_section(layout),
+ (size == 64 ?
+ elfcpp::R_SPARC_TLS_TPOFF64 :
+ elfcpp::R_SPARC_TLS_TPOFF32));
}
else if (optimized_type != tls::TLSOPT_TO_LE)
unsupported_reloc_global(object, r_type, gsym);
@@ -2462,11 +2462,11 @@ Target_sparc<size, big_endian>::Scan::global(
// Create a GOT entry for the tp-relative offset.
Output_data_got<size, big_endian>* got
= target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_TPOFF64 :
- elfcpp::R_SPARC_TLS_TPOFF32));
+ got->add_global_with_rel(gsym, GOT_TYPE_TLS_OFFSET,
+ target->rela_dyn_section(layout),
+ (size == 64
+ ? elfcpp::R_SPARC_TLS_TPOFF64
+ : elfcpp::R_SPARC_TLS_TPOFF32));
}
else if (optimized_type != tls::TLSOPT_TO_LE)
unsupported_reloc_global(object, r_type, gsym);