summaryrefslogtreecommitdiffstats
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc41
1 files changed, 35 insertions, 6 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index b9f9f17acc..a0c4fce889 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -2113,12 +2113,14 @@ Target_x86_64<size>::Scan::get_reference_flags(unsigned int r_type)
case elfcpp::R_X86_64_PC64:
case elfcpp::R_X86_64_PC32:
+ case elfcpp::R_X86_64_PC32_BND:
case elfcpp::R_X86_64_PC16:
case elfcpp::R_X86_64_PC8:
case elfcpp::R_X86_64_GOTOFF64:
return Symbol::RELATIVE_REF;
case elfcpp::R_X86_64_PLT32:
+ case elfcpp::R_X86_64_PLT32_BND:
case elfcpp::R_X86_64_PLTOFF64:
return Symbol::FUNCTION_CALL | Symbol::RELATIVE_REF;
@@ -2200,6 +2202,7 @@ Target_x86_64<size>::Scan::check_non_pic(Relobj* object, unsigned int r_type,
// glibc supports these reloc types, but they can overflow.
case elfcpp::R_X86_64_PC32:
+ case elfcpp::R_X86_64_PC32_BND:
// A PC relative reference is OK against a local symbol or if
// the symbol is defined locally.
if (gsym == NULL
@@ -2219,12 +2222,28 @@ Target_x86_64<size>::Scan::check_non_pic(Relobj* object, unsigned int r_type,
object->error(_("requires dynamic R_X86_64_32 reloc which may "
"overflow at runtime; recompile with -fPIC"));
else
- object->error(_("requires dynamic %s reloc against '%s' which may "
- "overflow at runtime; recompile with -fPIC"),
- (r_type == elfcpp::R_X86_64_32
- ? "R_X86_64_32"
- : "R_X86_64_PC32"),
- gsym->name());
+ {
+ const char *r_name;
+ switch (r_type)
+ {
+ case elfcpp::R_X86_64_32:
+ r_name = "R_X86_64_32";
+ break;
+ case elfcpp::R_X86_64_PC32:
+ r_name = "R_X86_64_PC32";
+ break;
+ case elfcpp::R_X86_64_PC32_BND:
+ r_name = "R_X86_64_PC32_BND";
+ break;
+ default:
+ gold_unreachable();
+ break;
+ }
+ object->error(_("requires dynamic %s reloc against '%s' "
+ "which may overflow at runtime; recompile "
+ "with -fPIC"),
+ r_name, gsym->name());
+ }
this->issued_non_pic_error_ = true;
return;
@@ -2368,11 +2387,13 @@ Target_x86_64<size>::Scan::local(Symbol_table* symtab,
case elfcpp::R_X86_64_PC64:
case elfcpp::R_X86_64_PC32:
+ case elfcpp::R_X86_64_PC32_BND:
case elfcpp::R_X86_64_PC16:
case elfcpp::R_X86_64_PC8:
break;
case elfcpp::R_X86_64_PLT32:
+ case elfcpp::R_X86_64_PLT32_BND:
// Since we know this is a local symbol, we can handle this as a
// PC32 reloc.
break;
@@ -2765,6 +2786,7 @@ Target_x86_64<size>::Scan::global(Symbol_table* symtab,
case elfcpp::R_X86_64_PC64:
case elfcpp::R_X86_64_PC32:
+ case elfcpp::R_X86_64_PC32_BND:
case elfcpp::R_X86_64_PC16:
case elfcpp::R_X86_64_PC8:
{
@@ -2869,6 +2891,7 @@ Target_x86_64<size>::Scan::global(Symbol_table* symtab,
break;
case elfcpp::R_X86_64_PLT32:
+ case elfcpp::R_X86_64_PLT32_BND:
// If the symbol is fully resolved, this is just a PC32 reloc.
// Otherwise we need a PLT entry.
if (gsym->final_value_is_known())
@@ -3217,6 +3240,8 @@ Target_x86_64<size>::Relocate::relocate(
if (this->skip_call_tls_get_addr_)
{
if ((r_type != elfcpp::R_X86_64_PLT32
+ && r_type != elfcpp::R_X86_64_PLT32_BND
+ && r_type != elfcpp::R_X86_64_PC32_BND
&& r_type != elfcpp::R_X86_64_PC32)
|| gsym == NULL
|| strcmp(gsym->name(), "__tls_get_addr") != 0)
@@ -3320,6 +3345,7 @@ Target_x86_64<size>::Relocate::relocate(
break;
case elfcpp::R_X86_64_PC32:
+ case elfcpp::R_X86_64_PC32_BND:
Relocate_functions<size, false>::pcrela32(view, object, psymval, addend,
address);
break;
@@ -3343,6 +3369,7 @@ Target_x86_64<size>::Relocate::relocate(
break;
case elfcpp::R_X86_64_PLT32:
+ case elfcpp::R_X86_64_PLT32_BND:
gold_assert(gsym == NULL
|| gsym->has_plt_offset()
|| gsym->final_value_is_known()
@@ -4151,7 +4178,9 @@ Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc(
case elfcpp::R_X86_64_32:
case elfcpp::R_X86_64_32S:
case elfcpp::R_X86_64_PC32:
+ case elfcpp::R_X86_64_PC32_BND:
case elfcpp::R_X86_64_PLT32:
+ case elfcpp::R_X86_64_PLT32_BND:
case elfcpp::R_X86_64_GOTPC32:
case elfcpp::R_X86_64_GOT32:
return 4;
OpenPOWER on IntegriCloud