Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jul 2016 23:57:28 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Ed Schouten <ed@nuxi.nl>
Cc:        "Pedro F. Giffuni" <pfg@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r303046 - head/lib/libc/locale
Message-ID:  <20160719215727.GA45133@stack.nl>
In-Reply-To: <CABh_MK=Pk%2BjxjY8jPu36RraaCfA0O5NzJUEVGJBMYe8ePtfnmQ@mail.gmail.com>
References:  <201607192022.u6JKMDJD051361@repo.freebsd.org> <CABh_MK=Pk%2BjxjY8jPu36RraaCfA0O5NzJUEVGJBMYe8ePtfnmQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 19, 2016 at 10:46:36PM +0200, Ed Schouten wrote:
> 2016-07-19 22:22 GMT+02:00 Pedro F. Giffuni <pfg@freebsd.org>:
> > Author: pfg
> > Date: Tue Jul 19 20:22:13 2016
> > New Revision: 303046
> > URL: https://svnweb.freebsd.org/changeset/base/303046

> > Log:
> >   libc: tag the Rune initialization function prototypes visibility
> >   as hidden.

> How does this interact with symbol versioning/mapping? Wouldn't our C
> library's symbol map already make these symbols hidden without any
> explicit annotation?

Trying to export (using a version script) a symbol with hidden
visibility attribute is an error, but GNU ld might accept it and fix it
up using text relocations or by not exporting the symbol.

Although both version scripts and visibility attributes can be used to
prevent exporting symbols, the goals are different. The goal of version
scripts is to enforce that no symbol is exported that is not in the
version script. The goal of visibility attributes is to optimize
performance and code size.

For example, on i386, a function without visibility attributes that is
not exported is called directly but still has %ebx set up for the PLT
entry. This not only adds extra instructions and stack usage but also
prevents tail calls (clang called the GOT entry indirectly for a while
to allow tail calls but this was removed because some code depended on
lazy resolution which requires PLT entries).

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160719215727.GA45133>