mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-26 12:41:05 +00:00
3d1870fa33
On the Hurd, the rtld needs to see its own dumb versions of a few functions (defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once loaded. rtld should thus not have hidden attribute for these. To achieve this, the Hurd port used to just define NO_HIDDEN, which disables it completely. For now, this changes that to disabling it for all rtld functions, for simplicity. See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5 The ld.so numbers remain at 8 .rel.plt 000000c8 00000c24 00000c24 00000c24 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .plt 000001a0 00000cf0 00000cf0 00000cf0 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 10 .plt.got 00000010 00000e90 00000e90 00000e90 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 18 .got.plt 00000070 0002d000 0002d000 0002c000 2**2 CONTENTS, ALLOC, LOAD, DATA which is about 3 times as much as on Linux. The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls) * include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto, rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak, rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak, rtld_hidden_data_ver): Define to empty. * include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail, __assert_perror_fail): Likewise. * include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__rewinddir): Likewise. * include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__profile_frequency): Likewise. * include/setjmp.h (__sigsetjmp): Likewise. * include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction, __libc_sigaction): Likewise. * include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do not set hidden attribute. * include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup, __strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset, rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise. * include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64, __fxstatat64): Likewise. * include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__uname): Likewise. * include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (_itoa_upper_digits, _itoa_lower_digits): Likewise. * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set. (NO_RTLD_HIDDEN): Set. * sysdeps/mach/hurd/configure: Refresh. * config.h.in: Refresh.
86 lines
2.9 KiB
C
86 lines
2.9 KiB
C
#ifndef _DIRENT_H
|
|
# ifndef _ISOMAC
|
|
# include <dirstream.h>
|
|
# endif
|
|
# include <dirent/dirent.h>
|
|
# ifndef _ISOMAC
|
|
# include <sys/stat.h>
|
|
# include <stdbool.h>
|
|
|
|
struct scandir_cancel_struct
|
|
{
|
|
DIR *dp;
|
|
void *v;
|
|
size_t cnt;
|
|
};
|
|
|
|
/* Now define the internal interfaces. */
|
|
extern DIR *__opendir (const char *__name) attribute_hidden;
|
|
extern DIR *__opendirat (int dfd, const char *__name) attribute_hidden;
|
|
extern DIR *__fdopendir (int __fd) attribute_hidden;
|
|
extern int __closedir (DIR *__dirp) attribute_hidden;
|
|
extern struct dirent *__readdir (DIR *__dirp) attribute_hidden;
|
|
extern struct dirent64 *__readdir64 (DIR *__dirp);
|
|
libc_hidden_proto (__readdir64)
|
|
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
|
|
struct dirent **__result);
|
|
extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
|
|
struct dirent64 **__result);
|
|
extern int __scandir64 (const char * __dir,
|
|
struct dirent64 *** __namelist,
|
|
int (*__selector) (const struct dirent64 *),
|
|
int (*__cmp) (const struct dirent64 **,
|
|
const struct dirent64 **));
|
|
extern __ssize_t __getdirentries (int __fd, char *__restrict __buf,
|
|
size_t __nbytes,
|
|
__off_t *__restrict __basep)
|
|
__THROW __nonnull ((2, 4));
|
|
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
|
|
attribute_hidden;
|
|
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
|
|
attribute_hidden;
|
|
extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
|
|
__attribute_pure__;
|
|
extern int __versionsort64 (const struct dirent64 **a,
|
|
const struct dirent64 **b)
|
|
__attribute_pure__;
|
|
extern DIR *__alloc_dir (int fd, bool close_fd, int flags,
|
|
const struct stat64 *statp) attribute_hidden;
|
|
extern __typeof (rewinddir) __rewinddir;
|
|
extern __typeof (seekdir) __seekdir;
|
|
extern __typeof (dirfd) __dirfd;
|
|
|
|
extern void __scandir_cancel_handler (void *arg) attribute_hidden;
|
|
extern int __scandir_tail (DIR *dp,
|
|
struct dirent ***namelist,
|
|
int (*select) (const struct dirent *),
|
|
int (*cmp) (const struct dirent **,
|
|
const struct dirent **))
|
|
attribute_hidden;
|
|
# ifdef _DIRENT_MATCHES_DIRENT64
|
|
# define __scandir64_tail (dp, namelist, select, cmp) \
|
|
__scandir_tail (dp, (struct dirent ***) (namelist), \
|
|
(int (*) (const struct dirent *)) (select), \
|
|
(int (*) (const struct dirent **, \
|
|
const struct dirent **)) (cmp))
|
|
# else
|
|
extern int __scandir64_tail (DIR *dp,
|
|
struct dirent64 ***namelist,
|
|
int (*select) (const struct dirent64 *),
|
|
int (*cmp) (const struct dirent64 **,
|
|
const struct dirent64 **))
|
|
attribute_hidden;
|
|
# endif
|
|
|
|
libc_hidden_proto (__rewinddir)
|
|
extern __typeof (scandirat) __scandirat;
|
|
libc_hidden_proto (__scandirat)
|
|
libc_hidden_proto (scandirat64)
|
|
|
|
# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
|
|
extern __typeof (__rewinddir) __rewinddir attribute_hidden;
|
|
# endif
|
|
# endif
|
|
|
|
#endif
|