http://sourceware.org/bugzilla/show_bug.cgi?id=14961
Bug #: 14961
Summary: IFUNC pointer doesn't work for i386
Product: binutils
Version: 2.24 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
[hjl@gnu-6 ifunc-xxx]$ cat foo.c
static int
two (void)
{
return 2;
}
void * foo_ifunc (void) __asm__ ("foo") __attribute__ ((visibility
("hidden")));
__asm__(".type foo, %gnu_indirect_function");
void *
foo_ifunc (void)
{
return two;
}
extern int foo (void) __attribute__ ((visibility ("hidden")));
int (*foo1_ptr) (void);
void
bar (void)
{
foo1_ptr = foo;
}
[hjl@gnu-6 ifunc-xxx]$ cat main.c
#include <stdlib.h>
extern int (*foo1_ptr) (void);
extern void bar (void);
int
main (void)
{
int foo1;
bar ();
foo1 = foo1_ptr ();
if (foo1 != 2)
abort ();
return 0;
}
[hjl@gnu-6 ifunc-xxx]$ make
gcc -m32 -O3 -c -o main.o main.c
gcc -m32 -O3 -fPIC -c -o foo.o foo.c
./ld -m elf_i386 --shared -o libfoo.so -z nocombreloc foo.o
gcc -m32 -o main main.o libfoo.so -Wl,-rpath,.
./main
make: *** [all] Segmentation fault
[hjl@gnu-6 ifunc-xxx]$
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils