public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/50483] New: lto turns visibility from HIDDEN to DEFAULT
Date: Thu, 22 Sep 2011 11:26:00 -0000	[thread overview]
Message-ID: <bug-50483-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 50483
           Summary: lto turns visibility from HIDDEN to DEFAULT
    Classification: Unclassified
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch
              Host: x86
            Target: x86_64-unknown-linux-gnu
             Build: 4.7.0 20110919


not sure how relevant is in practice BUT in the example below one may notice
that the visibility of "bar" is turned to DEFAULT by lto
no lto
17: 0000000000000597    11 FUNC    LOCAL  HIDDEN    11 bar()
lto
11: 0000000000000597    11 FUNC    LOCAL  DEFAULT   11 bar() .2238


cat vislto.cc
void ext();
void bar() __attribute((visibility( "hidden" )));
void foo() __attribute((visibility( "default" )));

void foo() { bar();}
void bar() { ext();}
g++ -fPIC vislto.cc -Wall -shared -o libvislto.so
[vinavx0] ~/public/ctest $ readelf -sW libvislto.so | grep -v UND | sed 's/\./
\./g' | c++filt

Symbol table ' .dynsym' contains 11 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     2: 0000000000000478     0 FUNC    GLOBAL DEFAULT    9 _init
     3: 00000000000005e8     0 FUNC    GLOBAL DEFAULT   12 _fini
     6: 000000000000058c    11 FUNC    GLOBAL DEFAULT   11 foo()
     8: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
     9: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
    10: 00000000000018e0     0 NOTYPE  GLOBAL DEFAULT  ABS _end

Symbol table ' .symtab' contains 31 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     1: 00000000000004c0     0 FUNC    LOCAL  DEFAULT   11 call_gmon_start
     2: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff .c
     3: 00000000000018a8     0 OBJECT  LOCAL  DEFAULT   19 __CTOR_LIST__
     4: 00000000000018b8     0 OBJECT  LOCAL  DEFAULT   20 __DTOR_LIST__
     5: 00000000000018c8     0 OBJECT  LOCAL  DEFAULT   21 __JCR_LIST__
     6: 00000000000004e0     0 FUNC    LOCAL  DEFAULT   11
__do_global_dtors_aux
     7: 00000000000018d0     1 OBJECT  LOCAL  DEFAULT   22 completed .5901
     8: 00000000000018d8     8 OBJECT  LOCAL  DEFAULT   22 dtor_idx .5903
     9: 0000000000000560     0 FUNC    LOCAL  DEFAULT   11 frame_dummy
    10: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS vislto .cc
    11: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff .c
    12: 00000000000018b0     0 OBJECT  LOCAL  DEFAULT   19 __CTOR_END__
    13: 0000000000000650     0 OBJECT  LOCAL  DEFAULT   13 __FRAME_END__
    14: 00000000000018c8     0 OBJECT  LOCAL  DEFAULT   21 __JCR_END__
    15: 00000000000005b0     0 FUNC    LOCAL  DEFAULT   11
__do_global_ctors_aux
    16: 00000000000018a0     0 OBJECT  LOCAL  HIDDEN    18 __dso_handle
    17: 0000000000000597    11 FUNC    LOCAL  HIDDEN    11 bar()
    18: 00000000000018c0     0 OBJECT  LOCAL  HIDDEN    20 __DTOR_END__
    19: 0000000000001670   496 OBJECT  LOCAL  HIDDEN    15 _DYNAMIC
    20: 0000000000001878    40 OBJECT  LOCAL  HIDDEN    17
_GLOBAL_OFFSET_TABLE_
    22: 0000000000000478     0 FUNC    GLOBAL DEFAULT    9 _init
    23: 00000000000005e8     0 FUNC    GLOBAL DEFAULT   12 _fini
    26: 000000000000058c    11 FUNC    GLOBAL DEFAULT   11 foo()
    28: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
    29: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
    30: 00000000000018e0     0 NOTYPE  GLOBAL DEFAULT  ABS _end
[vinavx0] ~/public/ctest $ g++ -fPIC vislto.cc -Wall -shared -o libvislto.so
-flto
[vinavx0] ~/public/ctest $ readelf -sW libvislto.so | grep -v UND | sed 's/\./
\./g' | c++filt

Symbol table ' .dynsym' contains 11 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     2: 0000000000000478     0 FUNC    GLOBAL DEFAULT    9 _init
     3: 00000000000005e8     0 FUNC    GLOBAL DEFAULT   12 _fini
     6: 000000000000058c    11 FUNC    GLOBAL DEFAULT   11 foo()
     8: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
     9: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
    10: 00000000000018e0     0 NOTYPE  GLOBAL DEFAULT  ABS _end

Symbol table ' .symtab' contains 31 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     1: 00000000000004c0     0 FUNC    LOCAL  DEFAULT   11 call_gmon_start
     2: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff .c
     3: 00000000000018a8     0 OBJECT  LOCAL  DEFAULT   19 __CTOR_LIST__
     4: 00000000000018b8     0 OBJECT  LOCAL  DEFAULT   20 __DTOR_LIST__
     5: 00000000000018c8     0 OBJECT  LOCAL  DEFAULT   21 __JCR_LIST__
     6: 00000000000004e0     0 FUNC    LOCAL  DEFAULT   11
__do_global_dtors_aux
     7: 00000000000018d0     1 OBJECT  LOCAL  DEFAULT   22 completed .5901
     8: 00000000000018d8     8 OBJECT  LOCAL  DEFAULT   22 dtor_idx .5903
     9: 0000000000000560     0 FUNC    LOCAL  DEFAULT   11 frame_dummy
    10: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS cclww4iv .ltrans0 .o
    11: 0000000000000597    11 FUNC    LOCAL  DEFAULT   11 bar() .2238
    12: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff .c
    13: 00000000000018b0     0 OBJECT  LOCAL  DEFAULT   19 __CTOR_END__
    14: 0000000000000650     0 OBJECT  LOCAL  DEFAULT   13 __FRAME_END__
    15: 00000000000018c8     0 OBJECT  LOCAL  DEFAULT   21 __JCR_END__
    16: 00000000000005b0     0 FUNC    LOCAL  DEFAULT   11
__do_global_ctors_aux
    17: 00000000000018a0     0 OBJECT  LOCAL  HIDDEN    18 __dso_handle
    18: 00000000000018c0     0 OBJECT  LOCAL  HIDDEN    20 __DTOR_END__
    19: 0000000000001670   496 OBJECT  LOCAL  HIDDEN    15 _DYNAMIC
    20: 0000000000001878    40 OBJECT  LOCAL  HIDDEN    17
_GLOBAL_OFFSET_TABLE_
    22: 0000000000000478     0 FUNC    GLOBAL DEFAULT    9 _init
    23: 00000000000005e8     0 FUNC    GLOBAL DEFAULT   12 _fini
    26: 000000000000058c    11 FUNC    GLOBAL DEFAULT   11 foo()
    28: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
    29: 00000000000018d0     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
    30: 00000000000018e0     0 NOTYPE  GLOBAL DEFAULT  ABS _end


             reply	other threads:[~2011-09-22 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 11:26 vincenzo.innocente at cern dot ch [this message]
2011-09-25 12:04 ` [Bug lto/50483] " rguenth at gcc dot gnu.org
2022-01-01 23:20 ` pinskia at gcc dot gnu.org
2022-01-01 23:28 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50483-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).