From f3a53f095cd8ba108f8ac780da27a5ebbf4b224f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Sep 2015 02:44:05 +0000 Subject: eliminate protected-visibility data in libc.so with vis.h preinclude some newer binutils versions print scary warnings about protected data because most gcc versions fail to produce the right address references/relocations for such data that might be subject to copy relocations. originally vis.h explicitly assigned default visibility to all public data symbols to avoid this issue, but commit b8dda24fe1caa901a99580f7a52defb95aedb67c removed this treatment for stdin/out/err to work around a gcc 3.x bug, and since they don't actually need it (because taking their addresses is not valid C). instead, a check for the gcc 3.x bug is added to the configure check for vis.h preinclude support; this feature will simply be disabled when using a buggy version of gcc. --- src/internal/vis.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/internal/vis.h') diff --git a/src/internal/vis.h b/src/internal/vis.h index a01fda18..bf7a5b20 100644 --- a/src/internal/vis.h +++ b/src/internal/vis.h @@ -11,6 +11,9 @@ * fail to support copy relocations for protected data, so exclude all * exported data symbols. */ +__attribute__((__visibility__("default"))) +extern struct _IO_FILE *const stdin, *const stdout, *const stderr; + __attribute__((__visibility__("default"))) extern int optind, opterr, optopt, optreset, __optreset, getdate_err, h_errno, daylight, __daylight, signgam, __signgam; -- cgit v1.2.1