From 9b95fd0944e4206949e90633c3fed088202810ec Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 5 Sep 2018 12:43:34 -0400 Subject: define and use internal macros for hidden visibility, weak refs this cleans up what had become widespread direct inline use of "GNU C" style attributes directly in the source, and lowers the barrier to increased use of hidden visibility, which will be useful to recovering some of the efficiency lost when the protected visibility hack was dropped in commit dc2f368e565c37728b0d620380b849c3a1ddd78f, especially on archs where the PLT ABI is costly. --- src/exit/abort.c | 3 +-- src/exit/exit.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/exit') diff --git a/src/exit/abort.c b/src/exit/abort.c index d6bd546b..7c323d26 100644 --- a/src/exit/abort.c +++ b/src/exit/abort.c @@ -6,8 +6,7 @@ #include "libc.h" #include "ksigaction.h" -__attribute__((__visibility__("hidden"))) -volatile int __abort_lock[1]; +hidden volatile int __abort_lock[1]; _Noreturn void abort(void) { diff --git a/src/exit/exit.c b/src/exit/exit.c index bf7835a1..a6869b37 100644 --- a/src/exit/exit.c +++ b/src/exit/exit.c @@ -12,8 +12,7 @@ weak_alias(dummy, __funcs_on_exit); weak_alias(dummy, __stdio_exit); weak_alias(dummy, _fini); -__attribute__((__weak__, __visibility__("hidden"))) -extern void (*const __fini_array_start)(void), (*const __fini_array_end)(void); +extern weak hidden void (*const __fini_array_start)(void), (*const __fini_array_end)(void); static void libc_exit_fini(void) { -- cgit v1.2.1