+2017-09-24 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * sysdeps/mach/hurd/dl-sysdep.c (check_no_hidden): New macro.
+ (__open, __close, __libc_read, __libc_write, __writev, __libc_lseek64,
+ __mmap, __fxstat64, __xstat64, __access, __access_noerrno, __getpid,
+ __getcwd, __sbrk, __strtoul_internal, _exit, abort): Use check_no_hidden
+ to make sure that these symbols are defined.
+
2017-09-22 Joseph Myers <joseph@codesourcery.com>
* sysdeps/ieee754/flt-32/s_asinhf.c: Include <libm-alias-float.h>.
dynamic linker re-relocates itself to be user-visible (for -ldl),
it will get the user's definition (i.e. usually libc's). */
+/* This macro checks that the function does not get renamed to be hidden: we do
+ need these to be overridable by libc's. */
+#define check_no_hidden(name) \
+static void __check_##name##_no_hidden(void) __attribute__((alias(#name)));
+
/* Open FILE_NAME and return a Hurd I/O for it in *PORT, or return an
error. If STAT is non-zero, stat the file into that stat buffer. */
static error_t
return err;
}
+check_no_hidden(__open);
int weak_function
__open (const char *file_name, int mode, ...)
{
return (int)port;
}
+check_no_hidden(__close);
int weak_function
__close (int fd)
{
return 0;
}
+check_no_hidden(__libc_read);
__ssize_t weak_function
__libc_read (int fd, void *buf, size_t nbytes)
{
}
libc_hidden_weak (__libc_read)
+check_no_hidden(__libc_write);
__ssize_t weak_function
__libc_write (int fd, const void *buf, size_t nbytes)
{
libc_hidden_weak (__libc_write)
/* This is only used for printing messages (see dl-misc.c). */
+check_no_hidden(__writev);
__ssize_t weak_function
__writev (int fd, const struct iovec *iov, int niov)
{
return 0;
}
-
+check_no_hidden(__libc_lseek64);
off64_t weak_function
__libc_lseek64 (int fd, off64_t offset, int whence)
{
return offset;
}
+check_no_hidden(__mmap);
void *weak_function
__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
{
return (void *) mapaddr;
}
+check_no_hidden(__fxstat64);
int weak_function
__fxstat64 (int vers, int fd, struct stat64 *buf)
{
}
libc_hidden_def (__fxstat64)
+check_no_hidden(__xstat64);
int weak_function
__xstat64 (int vers, const char *file, struct stat64 *buf)
{
whether debugging malloc is allowed even for SUID binaries. This
stub will always fail, which means that malloc-debugging is always
disabled for SUID binaries. */
+check_no_hidden(__access);
int weak_function
__access (const char *file, int type)
{
errno = ENOSYS;
return -1;
}
+check_no_hidden(__access_noerrno);
int weak_function
__access_noerrno (const char *file, int type)
{
return -1;
}
+check_no_hidden(__getpid);
pid_t weak_function
__getpid (void)
{
the functionality here. (We could, it just requires duplicating or
reusing getcwd.c's code but using our special lookup function as in
`open', above.) */
-char *
-weak_function
+check_no_hidden(__getcwd);
+char *weak_function
__getcwd (char *buf, size_t size)
{
errno = ENOSYS;
/* This is used by dl-tunables.c to strdup strings. We can just make this a
mere allocation. */
-void *
-weak_function
+check_no_hidden(__sbrk);
+void *weak_function
__sbrk (intptr_t increment)
{
vm_address_t addr;
return (void *) addr;
}
-unsigned long int
-weak_function
+check_no_hidden(__strtoul_internal);
+unsigned long int weak_function
__strtoul_internal (const char *nptr, char **endptr, int base, int group)
{
assert (base == 0 || base == 10);
strong_alias (__strtoul_internal, __GI___strtoul_internal)
strong_alias (__strtoul_internal, __GI_____strtoul_internal)
+check_no_hidden(_exit);
void weak_function attribute_hidden
_exit (int status)
{
# define ABORT_INSTRUCTION
#endif
+check_no_hidden(abort);
void weak_function
abort (void)
{