Re: [PATCH v5 15/27] compiler: Option to default to hidden symbols

From: Randy Dunlap
Date: Mon Jun 25 2018 - 19:25:17 EST


On 06/25/18 15:39, Thomas Garnier wrote:
> Provide an option to default visibility to hidden except for key
> symbols. This option is disabled by default and will be used by x86_64
> PIE support to remove errors between compilation units.
>
> The default visibility is also enabled for external symbols that are
> compared as they maybe equals (start/end of sections). In this case,
> older versions of GCC will remove the comparison if the symbols are
> hidden. This issue exists at least on gcc 4.9 and before.
>
> Signed-off-by: Thomas Garnier <thgarnie@xxxxxxxxxx>
> ---

> diff --git a/init/Kconfig b/init/Kconfig
> index 24b60536e26b..d4f90cc38ede 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1718,6 +1718,13 @@ config PROFILING
> config TRACEPOINTS
> bool
>
> +#
> +# Default to hidden visibility for all symbols.
> +# Useful for Position Independent Code to reduce global references.
> +#
> +config DEFAULT_HIDDEN
> + bool
> +

I certainly would appreciate a better/more descriptive kconfig symbol name
here.

> source "arch/Kconfig"
>
> endmenu # General setup


thanks,
--
~Randy