[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/14961] New: IFUNC pointer doesn't work for i386
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/14961] New: IFUNC pointer doesn't work for i386 |
Date: |
Fri, 14 Dec 2012 19:37:43 +0000 |
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: address@hidden
ReportedBy: address@hidden
Classification: Unclassified
address@hidden 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;
}
address@hidden 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;
}
address@hidden 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
address@hidden 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 ld/14961] New: IFUNC pointer doesn't work for i386,
hjl.tools at gmail dot com <=