This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] hurd: Fix some ld.so symbol override from libc
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 17 Aug 2018 00:54:10 +0200
- Subject: Re: [PATCH 1/2] hurd: Fix some ld.so symbol override from libc
- References: <20180728142758.32338-1-samuel.thibault@ens-lyon.org> <20180728142758.32338-2-samuel.thibault@ens-lyon.org>
Hello,
Samuel Thibault, le sam. 28 juil. 2018 16:27:57 +0200, a ecrit:
> * include/unistd.h (__access): Set libc_hidden_proto instead of
> attribute_hidden.
> * io/access.c (__access): Set libc_hidden_def.
So is this approach OK ?
Samuel
> * sysdeps/mach/hurd/access.c (__access): Likewise.
> * sysdeps/unix/sysv/linux/access.c (__access): Likewise.
> * sysdeps/mach/hurd/i386/libc.abilist: Update accordingly.
> * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
> * sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
> ---
> ChangeLog | 6 ++++++
> include/unistd.h | 3 ++-
> io/access.c | 1 +
> sysdeps/mach/hurd/access.c | 1 +
> sysdeps/mach/hurd/i386/ld.abilist | 1 +
> sysdeps/mach/hurd/i386/libc.abilist | 1 +
> sysdeps/mach/hurd/i386/localplt.data | 2 +-
> sysdeps/unix/sysv/linux/access.c | 1 +
> 8 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 5f82d00b69..dfe30c416c 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -3,6 +3,12 @@
> * sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read,
> __sbrk): Do not set attribute_hidden.
> * sysdeps/mach/hurd/not-errno.h: New file.
> + * include/unistd.h (__access): Set libc_hidden_proto instead of
> + attribute_hidden.
> + * io/access.c (__access): Set libc_hidden_def.
> + * sysdeps/mach/hurd/access.c (__access): Likewise.
> + * sysdeps/unix/sysv/linux/access.c (__access): Likewise.
> + * sysdeps/mach/hurd/i386/libc.abilist: Update accordingly.
> * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
> * sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
>
> diff --git a/include/unistd.h b/include/unistd.h
> index a171b00326..f1bdabebb2 100644
> --- a/include/unistd.h
> +++ b/include/unistd.h
> @@ -23,7 +23,8 @@ libc_hidden_proto (tcgetpgrp)
> libc_hidden_proto (readlinkat)
>
> /* Now define the internal interfaces. */
> -extern int __access (const char *__name, int __type) attribute_hidden;
> +extern int __access (const char *__name, int __type);
> +libc_hidden_proto (__access)
> extern int __euidaccess (const char *__name, int __type);
> extern int __faccessat (int __fd, const char *__file, int __type, int __flag);
> extern int __faccessat_noerrno (int __fd, const char *__file, int __type,
> diff --git a/io/access.c b/io/access.c
> index 7130264ed7..4a3fbe674b 100644
> --- a/io/access.c
> +++ b/io/access.c
> @@ -39,6 +39,7 @@ __access (const char *file, int type)
> __set_errno (ENOSYS);
> return -1;
> }
> +libc_hidden_def (__access)
> stub_warning (access)
>
> weak_alias (__access, access)
> diff --git a/sysdeps/mach/hurd/access.c b/sysdeps/mach/hurd/access.c
> index 31fd5bea56..56b97128d9 100644
> --- a/sysdeps/mach/hurd/access.c
> +++ b/sysdeps/mach/hurd/access.c
> @@ -35,4 +35,5 @@ __access (const char *file, int type)
> {
> return __faccessat (AT_FDCWD, file, type, 0);
> }
> +libc_hidden_def (__access)
> weak_alias (__access, access)
> diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
> index c76b913486..8b7be44dde 100644
> --- a/sysdeps/mach/hurd/i386/ld.abilist
> +++ b/sysdeps/mach/hurd/i386/ld.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.2.6 __access F
> GLIBC_2.2.6 __close F
> GLIBC_2.2.6 __errno_location F
> GLIBC_2.2.6 __fxstat64 F
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index 64586d828d..6e26654d85 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -211,6 +211,7 @@ GLIBC_2.2.6 _S_msg_set_init_ports F
> GLIBC_2.2.6 _S_msg_sig_post F
> GLIBC_2.2.6 _S_msg_sig_post_untraced F
> GLIBC_2.2.6 ___brk_addr D 0x4
> +GLIBC_2.2.6 __access F
> GLIBC_2.2.6 __after_morecore_hook D 0x4
> GLIBC_2.2.6 __argz_count F
> GLIBC_2.2.6 __argz_next F
> diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
> index a5b5241b84..1c54993ac7 100644
> --- a/sysdeps/mach/hurd/i386/localplt.data
> +++ b/sysdeps/mach/hurd/i386/localplt.data
> @@ -32,7 +32,7 @@ ld.so: __libc_lseek64
> ld.so: __mmap
> ld.so: __fxstat64
> ld.so: __xstat64
> -#ld.so: __access
> +ld.so: __access
> ld.so: __access_noerrno
> ld.so: __getpid
> #ld.so: __getcwd
> diff --git a/sysdeps/unix/sysv/linux/access.c b/sysdeps/unix/sysv/linux/access.c
> index 2da8e68f47..4fc122e48f 100644
> --- a/sysdeps/unix/sysv/linux/access.c
> +++ b/sysdeps/unix/sysv/linux/access.c
> @@ -29,4 +29,5 @@ __access (const char *file, int type)
> return INLINE_SYSCALL_CALL (faccessat, AT_FDCWD, file, type);
> #endif
> }
> +libc_hidden_def (__access)
> weak_alias (__access, access)
> --
> 2.18.0
>
--
Samuel
<h> t: bah c'est tendre le pattern pour se faire matcher, hein