public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Smith <psmith@gnu.org>
To: Martin Sebor <msebor@gmail.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: gcc 7.3: Replacing global operator new/delete in shared libraries
Date: Fri, 09 Feb 2018 04:47:00 -0000	[thread overview]
Message-ID: <1518151626.3405.288.camel@gnu.org> (raw)
In-Reply-To: <1518049567.3405.255.camel@gnu.org>

On Wed, 2018-02-07 at 19:26 -0500, Paul Smith wrote:
> Thanks for the conversation.  I'm moving forward with a real global
> operator new/delete and working out the magic needed to ensure those
> symbols are not global in our shared library.

I remember one annoying thing I ran into: through compiler "magic" the
-fvisibility=hidden compile-time attribute is ignored when it comes to
global operator new/delete.  Similarly, it's a compiler error to force
visibility("hidden") in the declaration via __attribute__.

The only way to get operator new/delete to be hidden inside a shared
library is to really force it using a linker script that declares them
"local:" specifically.

      reply	other threads:[~2018-02-09  4:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 22:57 Paul Smith
2018-02-07 10:32 ` Marc Glisse
2018-02-07 14:48   ` Paul Smith
2018-02-08  0:17     ` Marc Glisse
2018-02-08  0:42       ` Paul Smith
2018-02-07 23:38 ` Martin Sebor
2018-02-07 23:59   ` Jonathan Wakely
2018-02-08  0:26   ` Paul Smith
2018-02-09  4:47     ` Paul Smith [this message]

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=1518151626.3405.288.camel@gnu.org \
    --to=psmith@gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=msebor@gmail.com \
    /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).