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 dc2f368e56, especially
on archs where the PLT ABI is costly.
This commit is contained in:
Rich Felker
2018-09-05 14:05:14 -04:00
parent 2de29bc994
commit 9b95fd0944
38 changed files with 94 additions and 125 deletions
+1 -2
View File
@@ -72,8 +72,7 @@ typedef Elf32_Phdr Phdr;
typedef Elf64_Phdr Phdr;
#endif
__attribute__((__weak__, __visibility__("hidden")))
extern const size_t _DYNAMIC[];
extern weak hidden const size_t _DYNAMIC[];
static void static_init_tls(size_t *aux)
{
+1 -2
View File
@@ -11,8 +11,7 @@ void __init_tls(size_t *);
static void dummy(void) {}
weak_alias(dummy, _init);
__attribute__((__weak__, __visibility__("hidden")))
extern void (*const __init_array_start)(void), (*const __init_array_end)(void);
extern weak hidden void (*const __init_array_start)(void), (*const __init_array_end)(void);
static void dummy1(void *p) {}
weak_alias(dummy1, __init_ssp);
+1 -2
View File
@@ -17,7 +17,6 @@ void __stack_chk_fail(void)
a_crash();
}
__attribute__((__visibility__("hidden")))
void __stack_chk_fail_local(void);
hidden void __stack_chk_fail_local(void);
weak_alias(__stack_chk_fail, __stack_chk_fail_local);