this is the first and simplest stage of removal of the SHARED macro,
which will eventually allow libc.a and libc.so to be produced from the
same object files.
the original motivation for these #ifdefs which are now being removed
was to allow building a static-only libc using a compiler that does
not support visibility. however, SHARED was the wrong condition to
test for this anyway; various assembly-language sources refer to
hidden symbols and declare them with the .hidden directive, making it
wrong to define the referenced symbols as non-hidden. if there is a
need in the future to build libc using compilers that lack visibility,
support could be moved to the build system or perhaps the __PIC__
macro could be checked instead of SHARED.
__attribute__((__visibility__("hidden")))
__attribute__((__visibility__("hidden")))
-void __stack_chk_fail_local(void)
-{
- a_crash();
-}
-
-#else
+void __stack_chk_fail_local(void);
weak_alias(__stack_chk_fail, __stack_chk_fail_local);
weak_alias(__stack_chk_fail, __stack_chk_fail_local);
typedef long syscall_arg_t;
#endif
typedef long syscall_arg_t;
#endif
__attribute__((visibility("hidden")))
__attribute__((visibility("hidden")))
long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
__syscall_cp(syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t,
syscall_arg_t, syscall_arg_t, syscall_arg_t);
long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
__syscall_cp(syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t,
syscall_arg_t, syscall_arg_t, syscall_arg_t);
* of position-independent code. */
#ifndef CRT
* of position-independent code. */
#ifndef CRT
-/* For shared libc.so, all symbols should be protected, but some toolchains
+/* Conceptually, all symbols should be protected, but some toolchains
* fail to support copy relocations for protected data, so exclude all
* fail to support copy relocations for protected data, so exclude all
- * exported data symbols. */
+ * exported data symbols. Also omit visibility for possibly-undefined
+ * weak references. */
__attribute__((__visibility__("default")))
extern struct _IO_FILE *const stdin, *const stdout, *const stderr;
__attribute__((__visibility__("default")))
extern struct _IO_FILE *const stdin, *const stdout, *const stderr;
__attribute__((__visibility__("default")))
extern char *optarg, **environ, **__environ, *tzname[2], *__tzname[2], *__progname, *__progname_full;
__attribute__((__visibility__("default")))
extern char *optarg, **environ, **__environ, *tzname[2], *__tzname[2], *__progname, *__progname_full;
-#pragma GCC visibility push(protected)
-
-#elif defined(__PIC__)
-
-/* If building static libc.a as position-independent code, try to make
- * everything hidden except possibly-undefined weak references. */
-
__attribute__((__visibility__("default")))
extern void (*const __init_array_start)(), (*const __init_array_end)(),
(*const __fini_array_start)(), (*const __fini_array_end)();
__attribute__((__visibility__("default")))
extern void (*const __init_array_start)(), (*const __init_array_end)(),
(*const __fini_array_start)(), (*const __fini_array_end)();
-#pragma GCC visibility push(hidden)
+#pragma GCC visibility push(protected)
#include <signal.h>
#include "syscall.h"
#include <signal.h>
#include "syscall.h"
__attribute__((__visibility__("hidden")))
__attribute__((__visibility__("hidden")))
int __sigsetjmp_tail(sigjmp_buf jb, int ret)
{
void *p = jb->__ss;
int __sigsetjmp_tail(sigjmp_buf jb, int ret)
{
void *p = jb->__ss;
#include "pthread_impl.h"
#include "syscall.h"
#include "pthread_impl.h"
#include "syscall.h"
__attribute__((__visibility__("hidden")))
__attribute__((__visibility__("hidden")))
long __syscall_cp_c();
static long sccp(syscall_arg_t nr,
long __syscall_cp_c();
static long sccp(syscall_arg_t nr,
#include "syscall.h"
#include "libc.h"
#include "syscall.h"
#include "libc.h"
__attribute__((__visibility__("hidden")))
__attribute__((__visibility__("hidden")))
long __cancel(), __syscall_cp_asm(), __syscall_cp_c();
long __cancel()
long __cancel(), __syscall_cp_asm(), __syscall_cp_c();
long __cancel()
set->__bits[s/8/sizeof *set->__bits] |= 1UL<<(s&8*sizeof *set->__bits-1);
}
set->__bits[s/8/sizeof *set->__bits] |= 1UL<<(s&8*sizeof *set->__bits-1);
}
__attribute__((__visibility__("hidden")))
__attribute__((__visibility__("hidden")))
extern const char __cp_begin[1], __cp_end[1], __cp_cancel[1];
static void cancel_handler(int sig, siginfo_t *si, void *ctx)
extern const char __cp_begin[1], __cp_end[1], __cp_cancel[1];
static void cancel_handler(int sig, siginfo_t *si, void *ctx)