public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "s_gccbugzilla at nedprod dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug other/15000] Support setting the default symbol visibility for ELF Date: Thu, 22 Apr 2004 20:37:00 -0000 [thread overview] Message-ID: <20040422201935.14810.qmail@sources.redhat.com> (raw) In-Reply-To: <20040418032536.15000.bryner@brianryner.com> ------- Additional Comments From s_gccbugzilla at nedprod dot com 2004-04-22 20:19 ------- (In reply to comment #17) > > Is > > your new patch and its use of the type decl instead of the class stack to store > > visibility a better solution here? > > I think the reasoning is just that we already have an appropriate place to store > this information, so why invent something new. Note that the attribute stored > on the type decl is basically used the same way that DECL_VISIBILITYSPECIFIED is > in your patch. DECL_VISIBILITY is still used for determining the actual > visibility of a symbol. Also, the 'overrides' thing requires a linear search of > the overrides list every time you assign symbol visibility, so why not just do a > linear search of the attributes list of the decl instead. There's something to > be said for simplicity as well, and the second patch is certainly much shorter > than the original. Sounds spot on to me. I'll remake my patch based on your new one. This may happen tonight, depending on other factors. > Could you please elaborate on your changes related to inline and virtual functions? Yes. As Dave Abrahams pointed out in that link I posted previously, we must ensure that setting class member visibility follows the same semantics as MSVC or nasty problems creep in (and he should certainly know, he's an extremely capable programmer). To my knowledge, MSVC treats inlineable code as a non-external symbol because it assumes it'll be assembled at the point of use - therefore almost all templated code won't appear in the DLL's export table. This implies that instantiations of templates have one per DLL and that instantiations are not shared across DLL's. The exception to this obviously is virtual methods in templates as these *must* be shared across DLL boundaries to work correctly - though having just said that, I don't actually know if MSVC does this or not - I'll have to come up with a test. I've followed this behaviour in my patch for GCC. It also comes with the significant benefit of totally removing all template generated symbols from the export table when compiled with -fvisibility=hidden which as template generated symbols tend to be very long, it very substantially reduces binary size and load times. The amazing thing is that the mangled symbol usually takes up more space than the code it represents so this is actually an optimisation! All this said, my understanding of how inlining works in MSVC as against GCC may be imperfect so I suggest running the patch past Dave before committing. I need to remove a warning generated when Boost.Python is compiled with visibility support patched in just to give it a real professional air! :) Are you happy with the pragma idea? Shall I implement that in the next patch? Cheers, Niall -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15000
next prev parent reply other threads:[~2004-04-22 20:19 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-04-18 4:27 [Bug other/15000] New: " bryner at brianryner dot com 2004-04-18 8:16 ` [Bug other/15000] " pinskia at gcc dot gnu dot org 2004-04-18 13:37 ` bryner at brianryner dot com 2004-04-19 2:59 ` s_gccbugzilla at nedprod dot com 2004-04-19 3:16 ` s_gccbugzilla at nedprod dot com 2004-04-19 3:18 ` pinskia at gcc dot gnu dot org 2004-04-19 15:21 ` bryner at brianryner dot com 2004-04-19 21:29 ` s_gccbugzilla at nedprod dot com 2004-04-19 23:52 ` bryner at brianryner dot com 2004-04-20 1:05 ` s_gccbugzilla at nedprod dot com 2004-04-20 9:05 ` bryner at brianryner dot com 2004-04-22 2:42 ` s_gccbugzilla at nedprod dot com 2004-04-22 2:51 ` bryner at brianryner dot com 2004-04-22 18:40 ` s_gccbugzilla at nedprod dot com 2004-04-22 18:48 ` bryner at brianryner dot com 2004-04-22 20:37 ` s_gccbugzilla at nedprod dot com [this message] 2004-04-22 21:21 ` zack at codesourcery dot com 2004-04-23 5:31 ` s_gccbugzilla at nedprod dot com 2004-04-28 19:43 ` s_gccbugzilla at nedprod dot com 2004-05-03 2:36 ` bryner at brianryner dot com 2004-05-03 4:18 ` s_gccbugzilla at nedprod dot com 2004-05-05 6:52 ` s_gccbugzilla at nedprod dot com 2004-05-05 8:26 ` bryner at brianryner dot com 2004-05-05 20:38 ` s_gccbugzilla at nedprod dot com 2004-05-06 3:21 ` s_gccbugzilla at nedprod dot com 2004-05-11 17:08 ` s_gccbugzilla at nedprod dot com 2004-05-13 11:42 ` s_gccbugzilla at nedprod dot com 2004-05-30 1:43 ` s_gccbugzilla at nedprod dot com 2004-07-25 22:52 ` cvs-commit at gcc dot gnu dot org 2004-07-25 23:34 ` s_gccbugzilla at nedprod dot com 2004-07-25 23:36 ` pinskia at gcc dot gnu dot org 2004-07-25 23:57 ` giovannibajo at libero dot it 2004-07-26 1:31 ` s_gccbugzilla at nedprod dot com 2004-08-17 3:06 ` cvs-commit at gcc dot gnu dot org 2004-08-18 22:51 ` pinskia at gcc dot gnu dot org 2004-09-01 16:21 ` cvs-commit at gcc dot gnu dot 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=20040422201935.14810.qmail@sources.redhat.com \ --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: linkBe 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).