diff options
author | Cary Coutant <ccoutant@google.com> | 2011-10-10 17:29:52 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-10-10 17:29:52 +0000 |
commit | 397b129b2a1e3d186e62ff37ecdbc329bf6bbc53 (patch) | |
tree | 201abe09b47a3367ca0ac89bcc64350e98d7e7b0 /gold/x86_64.cc | |
parent | 79395f921c81a0a14e92512674fc57971d3a4e2b (diff) | |
download | gdb-397b129b2a1e3d186e62ff37ecdbc329bf6bbc53.zip gdb-397b129b2a1e3d186e62ff37ecdbc329bf6bbc53.tar.gz gdb-397b129b2a1e3d186e62ff37ecdbc329bf6bbc53.tar.bz2 |
PR gold/13249
* gold/output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
(Output_reloc::symbol_value): Return PLT offset if flag is set.
* gold/output.h (class Output_reloc): Add use_plt_offset flag.
(Output_reloc::type_): Adjust size of bit field.
(Output_reloc::use_plt_offset_): New bit field.
(class Output_data_reloc): Adjust all calls to Output_reloc_type.
(Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
flag. Adjust all callers.
* gold/x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
creating RELATIVE relocations.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r-- | gold/x86_64.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc index e6b0021..e61d7d1 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -1549,7 +1549,7 @@ Target_x86_64::reserve_local_got_entry( case GOT_TYPE_STANDARD: if (parameters->options().output_is_position_independent()) rela_dyn->add_local_relative(obj, r_sym, elfcpp::R_X86_64_RELATIVE, - this->got_, got_offset, 0); + this->got_, got_offset, 0, false); break; case GOT_TYPE_TLS_OFFSET: rela_dyn->add_local(obj, r_sym, elfcpp::R_X86_64_TPOFF64, @@ -1953,8 +1953,8 @@ Target_x86_64::Scan::local(Symbol_table* symtab, const elfcpp::Sym<64, false>& lsym) { // A local STT_GNU_IFUNC symbol may require a PLT entry. - if (lsym.get_st_type() == elfcpp::STT_GNU_IFUNC - && this->reloc_needs_plt_for_ifunc(object, r_type)) + bool is_ifunc = lsym.get_st_type() == elfcpp::STT_GNU_IFUNC; + if (is_ifunc && this->reloc_needs_plt_for_ifunc(object, r_type)) { unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info()); target->make_local_ifunc_plt_entry(symtab, layout, object, r_sym); @@ -1982,7 +1982,7 @@ Target_x86_64::Scan::local(Symbol_table* symtab, elfcpp::R_X86_64_RELATIVE, output_section, data_shndx, reloc.get_r_offset(), - reloc.get_r_addend()); + reloc.get_r_addend(), is_ifunc); } break; @@ -2058,7 +2058,7 @@ Target_x86_64::Scan::local(Symbol_table* symtab, // lets function pointers compare correctly with shared // libraries. Otherwise we would need an IRELATIVE reloc. bool is_new; - if (lsym.get_st_type() == elfcpp::STT_GNU_IFUNC) + if (is_ifunc) is_new = got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD); else is_new = got->add_local(object, r_sym, GOT_TYPE_STANDARD); @@ -2076,7 +2076,7 @@ Target_x86_64::Scan::local(Symbol_table* symtab, object->local_got_offset(r_sym, GOT_TYPE_STANDARD); rela_dyn->add_local_relative(object, r_sym, elfcpp::R_X86_64_RELATIVE, - got, got_offset, 0); + got, got_offset, 0, is_ifunc); } else { |