This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold] PATCH: Support x32 IFUNC function pointer
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Cc: Ian Lance Taylor <iant at google dot com>
- Date: Fri, 27 Jan 2012 14:50:54 -0800
- Subject: [gold] PATCH: Support x32 IFUNC function pointer
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
We should check R_X86_64_32 for x32 function pointers. OK to install?
Thanks.
H.J.
---
2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
* x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index aafdd68..daa69f6 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -2476,7 +2476,8 @@ Target_x86_64<size>::Scan::global(Symbol_table* symtab,
target->copy_reloc(symtab, layout, object,
data_shndx, output_section, gsym, reloc);
}
- else if (r_type == elfcpp::R_X86_64_64
+ else if (((size == 64 && r_type == elfcpp::R_X86_64_64)
+ || (size == 32 && r_type == elfcpp::R_X86_64_32))
&& gsym->type() == elfcpp::STT_GNU_IFUNC
&& gsym->can_use_relative_reloc(false)
&& !gsym->is_from_dynobj()