aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2010-04-20 21:13:30 +0000
committerSriraman Tallam <tmsriram@google.com>2010-04-20 21:13:30 +0000
commitce97fa81e0c46d216b80b143ad8c02fff6906fef (patch)
tree539a9d93c76d2113b92da17405b144eba8fa92c5 /gold/x86_64.cc
parentec31cde5942e935e74f6ff919ffc480dfa2f1bac (diff)
downloadbinutils-ce97fa81e0c46d216b80b143ad8c02fff6906fef.zip
binutils-ce97fa81e0c46d216b80b143ad8c02fff6906fef.tar.gz
binutils-ce97fa81e0c46d216b80b143ad8c02fff6906fef.tar.bz2
2010-04-18 Sriraman Tallam <tmsriram@google.com>
* icf.cc (get_section_contents): Check for preemptible functions. Ignore addend when appropriate. * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for section folded. (add_from_relobj): Check for section folded. (set_dynsym_indexes): Fix call to should_add_dynsym_entry. * symtab.h (should_add_dynsym_entry): Add new parameter. * target-reloc.h (scan_relocs): Check for section folded. * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc): Check reloc types for function pointers in shared objects. * testsuite/Makefile.am (icf_virtual_function_folding_test): New test case. (icf_preemptible_functions_test): New test case. (icf_string_merge_test): New test case. * testsuite.Makefile.in: Regenerate. * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and bar_glob. Refactor code. * testsuite/icf_preemptible_functions_test.cc: New file. * testsuite/icf_preemptible_functions_test.sh: New file. * testsuite/icf_string_merge_test.cc: New file. * testsuite/icf_string_merge_test.sh: New file. * testsuite/icf_virtual_function_folding_test.cc: New file. * testsuite/icf_virtual_function_folding_test.sh: New file.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index e9dd5ae..9110278 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -1398,14 +1398,10 @@ Target_x86_64::Scan::unsupported_reloc_global(Sized_relobj<64, false>* object,
object->name().c_str(), r_type, gsym->demangled_name().c_str());
}
-// Returns true if this relocation type could be that of a function pointer
-// only if the target is not position-independent code.
+// Returns true if this relocation type could be that of a function pointer.
inline bool
Target_x86_64::Scan::possible_function_pointer_reloc(unsigned int r_type)
{
- if (parameters->options().shared())
- return false;
-
switch (r_type)
{
case elfcpp::R_X86_64_64:
@@ -1413,6 +1409,11 @@ Target_x86_64::Scan::possible_function_pointer_reloc(unsigned int r_type)
case elfcpp::R_X86_64_32S:
case elfcpp::R_X86_64_16:
case elfcpp::R_X86_64_8:
+ case elfcpp::R_X86_64_GOT64:
+ case elfcpp::R_X86_64_GOT32:
+ case elfcpp::R_X86_64_GOTPCREL64:
+ case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPLT64:
{
return true;
}