R_X86_64_RELATIVE64 = 38, // 64-bit adjust by program base
R_X86_64_PC32_BND = 39, // PC relative 32 bit signed with BND prefix
R_X86_64_PLT32_BND = 40, // 32 bit PLT address with BND prefix
+ R_X86_64_GOTPCRELX = 41, // 32 bit signed PC relative offset to GOT
+ // without REX prefix, relaxable.
+ R_X86_64_REX_GOTPCRELX = 42, // 32 bit signed PC relative offset to GOT
+ // with REX prefix, relaxable.
// GNU vtable garbage collection extensions.
R_X86_64_GNU_VTINHERIT = 250,
R_X86_64_GNU_VTENTRY = 251
+2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
+ Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
+ as R_X86_64_GOTPCREL.
+ (Target_x86_64<size>::Scan::local): Likewise.
+ (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
+ Likewise.
+ (Target_x86_64<size>::Scan::global): Likewise.
+ (Target_x86_64<size>::Relocate::relocate): Likewise.
+ (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
+ Likewise.
+
2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
* i386.cc (Target_i386::Scan::get_reference_flags(): Treat
case elfcpp::R_X86_64_GOT32:
case elfcpp::R_X86_64_GOTPCREL64:
case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPCRELX:
+ case elfcpp::R_X86_64_REX_GOTPCRELX:
case elfcpp::R_X86_64_GOTPLT64:
// Absolute in GOT.
return Symbol::ABSOLUTE_REF;
case elfcpp::R_X86_64_GOT32:
case elfcpp::R_X86_64_GOTPCREL64:
case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPCRELX:
+ case elfcpp::R_X86_64_REX_GOTPCRELX:
case elfcpp::R_X86_64_GOTPLT64:
{
// The symbol requires a GOT section.
// mov foo@GOTPCREL(%rip), %reg
// to lea foo(%rip), %reg.
// in Relocate::relocate.
- if (r_type == elfcpp::R_X86_64_GOTPCREL
+ if ((r_type == elfcpp::R_X86_64_GOTPCREL
+ || r_type == elfcpp::R_X86_64_GOTPCRELX
+ || r_type == elfcpp::R_X86_64_REX_GOTPCRELX)
&& reloc.get_r_offset() >= 2
&& !is_ifunc)
{
case elfcpp::R_X86_64_GOT32:
case elfcpp::R_X86_64_GOTPCREL64:
case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPCRELX:
+ case elfcpp::R_X86_64_REX_GOTPCRELX:
case elfcpp::R_X86_64_GOTPLT64:
{
return true;
case elfcpp::R_X86_64_GOT32:
case elfcpp::R_X86_64_GOTPCREL64:
case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPCRELX:
+ case elfcpp::R_X86_64_REX_GOTPCRELX:
case elfcpp::R_X86_64_GOTPLT64:
{
// The symbol requires a GOT entry.
// mov foo@GOTPCREL(%rip), %reg
// to lea foo(%rip), %reg.
// in Relocate::relocate, then there is nothing to do here.
- if (r_type == elfcpp::R_X86_64_GOTPCREL
+ if ((r_type == elfcpp::R_X86_64_GOTPCREL
+ || r_type == elfcpp::R_X86_64_GOTPCRELX
+ || r_type == elfcpp::R_X86_64_REX_GOTPCRELX)
&& reloc.get_r_offset() >= 2
&& Target_x86_64<size>::can_convert_mov_to_lea(gsym))
{
break;
case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPCRELX:
+ case elfcpp::R_X86_64_REX_GOTPCRELX:
{
// Convert
// mov foo@GOTPCREL(%rip), %reg
case elfcpp::R_X86_64_GOT64:
case elfcpp::R_X86_64_GOTPCREL64:
case elfcpp::R_X86_64_GOTPCREL:
+ case elfcpp::R_X86_64_GOTPCRELX:
+ case elfcpp::R_X86_64_REX_GOTPCRELX:
case elfcpp::R_X86_64_GOTPLT64:
return 8;