public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32470]  New: fvisibility=hidden without effect in some casses
@ 2007-06-23  3:46 gd at spherenet dot de
  2007-06-24  0:53 ` [Bug c++/32470] " pinskia at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: gd at spherenet dot de @ 2007-06-23  3:46 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following code with fvisibility=hidden exports Test::test().
(The used compiler is 4.2.1 20070622. Version 4.2.0 on a i686 gives the same
results).

~$ cat test.cc

#include <streambuf>
class Test
{
  void test();
};
void Test::test() { }

~$ g++ -fvisibility=hidden -fPIC -c -o test.o test.cc
~$ readelf -s test.o
Symbol table '.symtab' contains 12 entries:
 Num:    Value         Size Type    Bind   Vis      Ndx Name
   0: 0000000000000000    0 NOTYPE  LOCAL  DEFAULT  UND 
   1: 0000000000000000    0 FILE    LOCAL  DEFAULT  ABS test.cc
   2: 0000000000000000    0 SECTION LOCAL  DEFAULT    1 
   3: 0000000000000000    0 SECTION LOCAL  DEFAULT    2 
   4: 0000000000000000    0 SECTION LOCAL  DEFAULT    3 
   5: 0000000000000000    0 SECTION LOCAL  DEFAULT    4 
   6: 0000000000000000    0 SECTION LOCAL  DEFAULT    6 
   7: 0000000000000000    0 SECTION LOCAL  DEFAULT    9 
   8: 0000000000000000    0 SECTION LOCAL  DEFAULT    8 
   9: 0000000000000000   10 FUNC    GLOBAL DEFAULT    1 _ZN4Test4testEv
  10: 0000000000000000    0 NOTYPE  GLOBAL DEFAULT  UND __gxx_personality_v0
  11: 0000000000000000    8 OBJECT  WEAK   HIDDEN    6
DW.ref.__gxx_personality_

After removing #include <streambuf> from the testcase, Test::test() is hidden
as expected.

~$ g++ -fvisibility=hidden -fPIC -c -o test.o test.cc
~$ readelf -s test.o
Symbol table '.symtab' contains 12 entries:
 Num:    Value         Size Type    Bind   Vis      Ndx Name
   0: 0000000000000000    0 NOTYPE  LOCAL  DEFAULT  UND 
   1: 0000000000000000    0 FILE    LOCAL  DEFAULT  ABS test.cc
   2: 0000000000000000    0 SECTION LOCAL  DEFAULT    1 
   3: 0000000000000000    0 SECTION LOCAL  DEFAULT    2 
   4: 0000000000000000    0 SECTION LOCAL  DEFAULT    3 
   5: 0000000000000000    0 SECTION LOCAL  DEFAULT    4 
   6: 0000000000000000    0 SECTION LOCAL  DEFAULT    6 
   7: 0000000000000000    0 SECTION LOCAL  DEFAULT    9 
   8: 0000000000000000    0 SECTION LOCAL  DEFAULT    8 
   9: 0000000000000000   10 FUNC    GLOBAL HIDDEN    1 _ZN4Test4testEv
  10: 0000000000000000    0 NOTYPE  GLOBAL DEFAULT  UND __gxx_personality_v0
  11: 0000000000000000    8 OBJECT  WEAK   HIDDEN    6
DW.ref.__gxx_personality_


-- 
           Summary: fvisibility=hidden without effect in some casses
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gd at spherenet dot de
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32470


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-10-22 18:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-23  3:46 [Bug c++/32470] New: fvisibility=hidden without effect in some casses gd at spherenet dot de
2007-06-24  0:53 ` [Bug c++/32470] " pinskia at gcc dot gnu dot org
2007-06-25 23:38 ` gd at spherenet dot de
2007-07-02 15:01 ` [Bug c++/32470] fvisibility=hidden without effect in some cases gd at spherenet dot de
2007-09-11 22:38 ` mueller at gcc dot gnu dot org
2007-09-11 22:39 ` [Bug c++/32470] [4.2 regression] " mueller at gcc dot gnu dot org
2007-09-26 19:15 ` [Bug c++/32470] [4.2/4.3 " pinskia at gcc dot gnu dot org
2007-09-28  3:55 ` mmitchel at gcc dot gnu dot org
2007-10-01 14:42 ` gd at spherenet dot de
2007-10-04  1:31 ` jason at gcc dot gnu dot org
2007-10-04  8:48 ` jason at gcc dot gnu dot org
2007-10-04  8:51 ` [Bug c++/32470] [4.2 " jason at gcc dot gnu dot org
2007-10-09 19:30 ` mmitchel at gcc dot gnu dot org
2007-10-09 20:53 ` jason at gcc dot gnu dot org
2007-10-09 21:10 ` jason at gcc dot gnu dot org
2007-10-22 18:13 ` jason at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).