http://sourceware.org/bugzilla/show_bug.cgi?id=13880
Bug #: 13880 Summary: -Bsymbolic fails to handle protected function pointer Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassig...@sourceware.org ReportedBy: hjl.to...@gmail.com Classification: Unclassified [hjl@gnu-6 protected-1]$ cat shared.c typedef int (*protected_t) (void); int protected (void) __attribute__ ((visibility ("protected"))); int protected () { return 20; } protected_t protected_p () { return protected; } [hjl@gnu-6 protected-1]$ cat main.c #include <stdio.h> typedef int (*protected_t) (void); int protected (void); extern protected_t protected_p (void); void foo (protected_t f) { printf ("%p\n", f); printf ("%d\n", f ()); } int main() { protected_t f = protected_p (); foo (f); foo (protected); return 0; } [hjl@gnu-6 protected-1]$ make gcc -B./ -O -c main.c gcc -B./ -O -fPIC -mcmodel=large -c shared.c ./ld -shared -Bsymbolic -o libfoo.so shared.o ./ld: shared.o: relocation R_X86_64_GOTOFF64 against protected function `protected' can not be used when making a shared object ./ld: final link failed: Bad value make: *** [libfoo.so] Error 1 [hjl@gnu-6 protected-1]$ -- 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 bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils