This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Enable hidden visibility in libc.a compiled with PIE
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd at arm dot com
- Date: Mon, 21 Aug 2017 17:31:40 +0100
- Subject: Re: [PATCH] Enable hidden visibility in libc.a compiled with PIE
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <20170808164040.GA31184@gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 08/08/17 17:40, H.J. Lu wrote:
> When building libc.a with PIE, enable hidden visibility to allow direct
> access to definitions within libc.a without using GOT.
...
> -#if defined SHARED || defined LIBC_NONSHARED
> +#if defined SHARED || defined LIBC_NONSHARED \
> + || (BUILD_PIE_DEFAULT && IS_IN (libc))
> # define attribute_hidden __attribute__ ((visibility ("hidden")))
btw what happens if this is enabled for non-pie libc.a ?
i'd expect that to work too (it prevents some symbol
interpositions?)