[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/13880] New: -Bsymbolic fails to handle protected function pointe
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/13880] New: -Bsymbolic fails to handle protected function pointer |
Date: |
Tue, 20 Mar 2012 17:38:43 +0000 |
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: address@hidden
ReportedBy: address@hidden
Classification: Unclassified
address@hidden 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;
}
address@hidden 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;
}
address@hidden 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
address@hidden 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 ld/13880] New: -Bsymbolic fails to handle protected function pointer,
hjl.tools at gmail dot com <=