[v3,4/9] compile: Support relocation to GNU-IFUNCs

Message ID 20150411194355.29128.16665.stgit@host1.jankratochvil.net
State New, archived
Headers

Commit Message

Jan Kratochvil April 11, 2015, 7:43 p.m. UTC
  The 'compile print' part disclosed that calling memcpy() may fail as memcpy()
from libc is GNU-IFUNC.

gdb/ChangeLog
2015-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* compile/compile-object-load.c (compile_object_load): Support
	mst_text_gnu_ifunc.
---
 0 files changed
  

Comments

Pedro Alves April 29, 2015, 3:44 p.m. UTC | #1
On 04/11/2015 08:43 PM, Jan Kratochvil wrote:
> The 'compile print' part disclosed that calling memcpy() may fail as memcpy()
> from libc is GNU-IFUNC.
> 
> gdb/ChangeLog
> 2015-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* compile/compile-object-load.c (compile_object_load): Support
> 	mst_text_gnu_ifunc.

OK.

Thanks,
Pedro Alves
  
Jan Kratochvil May 6, 2015, 7 p.m. UTC | #2
On Wed, 29 Apr 2015 17:44:26 +0200, Pedro Alves wrote:
> On 04/11/2015 08:43 PM, Jan Kratochvil wrote:
> > The 'compile print' part disclosed that calling memcpy() may fail as memcpy()
> > from libc is GNU-IFUNC.
> > 
> > gdb/ChangeLog
> > 2015-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> > 	* compile/compile-object-load.c (compile_object_load): Support
> > 	mst_text_gnu_ifunc.
> 
> OK.

Checked in out of the series:
	e26efa4066a5076f59427c927cc51c52b6b92f35


Jan
  

Patch

diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 70b2e2e..ed2cad4 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -555,6 +555,10 @@  compile_object_load (const char *object_file, const char *source_file,
 	case mst_text:
 	  sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym);
 	  break;
+	case mst_text_gnu_ifunc:
+	  sym->value = gnu_ifunc_resolve_addr (target_gdbarch (),
+					       BMSYMBOL_VALUE_ADDRESS (bmsym));
+	  break;
 	default:
 	  warning (_("Could not find symbol \"%s\" "
 		     "for compiled module \"%s\"."),