Bug 44166 - -fvisibility=protected doesn't work?
Summary: -fvisibility=protected doesn't work?
Status: RESOLVED DUPLICATE of bug 37611
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2010-05-17 13:41 UTC by Jay
Modified: 2010-05-17 13:49 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Jay 2010-05-17 13:41:56 UTC
-fvisibility=protected doesn't work?

ay@xlin2:~$ cat 1.c
void F1() { }
void* F2() { return F1; }

jay@xlin2:~$ $HOME/bin/gcc 1.c -fPIC -shared -fvisibility=protected

/usr/bin/ld: /tmp/cc0d6EQ3.o: relocation R_386_GOTOFF against protected function `F1' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

jay@xlin2:~$ $HOME/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /src/gcc-4.5.0/configure -verbose -prefix=/home/jay -disable-bootstrap -disable-multilibs
Thread model: posix
gcc version 4.5.0 (GCC)
Comment 1 Andrew Pinski 2010-05-17 13:47:28 UTC
Can you give the output of ld --version ?  There might have been a binutils bug about this before.
Comment 2 Andrew Pinski 2010-05-17 13:49:28 UTC

*** This bug has been marked as a duplicate of 37611 ***