public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [hurd,commited] hurd: Fix some ld.so symbol override from libc
@ 2018-07-28 13:30 Samuel Thibault
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2018-07-28 13:30 UTC (permalink / raw)
  To: libc-alpha; +Cc: Samuel Thibault

ld.so symbols to be overriden by libc need to be extern to really get
overriden.

	* sysdeps/mach/hurd/not-errno.h: New file.
	* sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
---
 ChangeLog                            |  1 +
 sysdeps/mach/hurd/i386/localplt.data |  2 +-
 sysdeps/mach/hurd/not-errno.h        | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/mach/hurd/not-errno.h

diff --git a/ChangeLog b/ChangeLog
index 5885a61901..5f82d00b69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 	* sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read,
 	__sbrk): Do not set attribute_hidden.
+	* sysdeps/mach/hurd/not-errno.h: New file.
 	* sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
 	* sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
 
diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
index 78f8c877c6..a5b5241b84 100644
--- a/sysdeps/mach/hurd/i386/localplt.data
+++ b/sysdeps/mach/hurd/i386/localplt.data
@@ -33,7 +33,7 @@ ld.so: __mmap
 ld.so: __fxstat64
 ld.so: __xstat64
 #ld.so: __access
-#ld.so: __access_noerrno
+ld.so: __access_noerrno
 ld.so: __getpid
 #ld.so: __getcwd
 ld.so: __sbrk
diff --git a/sysdeps/mach/hurd/not-errno.h b/sysdeps/mach/hurd/not-errno.h
new file mode 100644
index 0000000000..838a5abc69
--- /dev/null
+++ b/sysdeps/mach/hurd/not-errno.h
@@ -0,0 +1,21 @@
+/* Syscall wrapper that do not set errno.  Generic version.
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* The __access_noerrno stub mustn't be hidden in ld.so on Hurd since it needs
+   to be preempted by __access_noerrno from libc.so after bootstrap.  */
+extern __typeof (__access) __access_noerrno;
-- 
2.18.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [hurd,commited] hurd: Fix some ld.so symbol override from libc
@ 2018-07-28 13:04 Samuel Thibault
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2018-07-28 13:04 UTC (permalink / raw)
  To: libc-alpha; +Cc: Samuel Thibault

ld.so symbols to be overriden by libc need to be extern to really get
overriden.

	* sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read,
	__sbrk): Do not set attribute_hidden.
	* sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
	* sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
---
 ChangeLog                            |  7 +++++++
 sysdeps/mach/hurd/dl-unistd.h        | 10 ++--------
 sysdeps/mach/hurd/i386/ld.abilist    |  2 ++
 sysdeps/mach/hurd/i386/localplt.data |  8 ++++----
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e5abf96411..5885a61901 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-07-28  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read,
+	__sbrk): Do not set attribute_hidden.
+	* sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
+	* sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
+
 2018-07-27  Carlos O'Donell  <carlos@redhat.com>
 
 	* po/uk.po: Update translations.
diff --git a/sysdeps/mach/hurd/dl-unistd.h b/sysdeps/mach/hurd/dl-unistd.h
index 81cdd9a8c5..da7f0ed18d 100644
--- a/sysdeps/mach/hurd/dl-unistd.h
+++ b/sysdeps/mach/hurd/dl-unistd.h
@@ -17,12 +17,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* __close, __getcwd, __getpid, __libc_read and __libc_write can't be
-   hidden in ld.so on Hurd since they will be preempted by the ones in
-   libc.so after bootstrap.  */
-extern __typeof (__access) __access attribute_hidden;
-extern __typeof (__brk) __brk attribute_hidden;
-extern __typeof (__lseek) __lseek attribute_hidden;
+/* Most stubs mustn't be hidden in ld.so on Hurd since they need to be preempted
+   by functions from libc.so after bootstrap.  */
 extern __typeof (__profil) __profil attribute_hidden;
-extern __typeof (__read) __read attribute_hidden;
-extern __typeof (__sbrk) __sbrk attribute_hidden;
diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
index 3a89b5a10e..c76b913486 100644
--- a/sysdeps/mach/hurd/i386/ld.abilist
+++ b/sysdeps/mach/hurd/i386/ld.abilist
@@ -6,6 +6,8 @@ GLIBC_2.2.6 __libc_stack_end D 0x4
 GLIBC_2.2.6 __mmap F
 GLIBC_2.2.6 __open F
 GLIBC_2.2.6 __open64 F
+GLIBC_2.2.6 __read F
+GLIBC_2.2.6 __sbrk F
 GLIBC_2.2.6 __strtoul_internal F
 GLIBC_2.2.6 __write F
 GLIBC_2.2.6 __writev F
diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
index 69d3a2568d..78f8c877c6 100644
--- a/sysdeps/mach/hurd/i386/localplt.data
+++ b/sysdeps/mach/hurd/i386/localplt.data
@@ -23,10 +23,10 @@ ld.so: _dl_catch_exception + REL R_386_GLOB_DAT
 # The dynamic linker has its own versions of basic functions for initial loading
 # of shared libraries.  These need to be overriden by libc once loaded.
 ld.so: __open ?
-ld.so: __open64 ?
+ld.so: __open64
 ld.so: __close
-ld.so: __read ?
-ld.so: __write ?
+ld.so: __read
+ld.so: __write
 ld.so: __writev
 ld.so: __libc_lseek64
 ld.so: __mmap
@@ -36,7 +36,7 @@ ld.so: __xstat64
 #ld.so: __access_noerrno
 ld.so: __getpid
 #ld.so: __getcwd
-#ld.so: __sbrk
+ld.so: __sbrk
 ld.so: __strtoul_internal
 #ld.so: _exit
 ld.so: abort
-- 
2.18.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [hurd,commited] hurd: Fix some ld.so symbol override from libc
@ 2018-07-27  9:22 Samuel Thibault
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2018-07-27  9:22 UTC (permalink / raw)
  To: libc-alpha; +Cc: Samuel Thibault

ld.so symbols to be overriden by libc need to be extern to really get
overriden.

More fixes are needed to avoid the hidden attribute.

	* sysdeps/mach/hurd/Versions (libc): Make __access and
	__access_noerrno external so they can override the ld symbols.
	(ld): Make __access, __read, __sbrk, __strtoul_internal, __write,
	__writev, __open64, __access_noerrno extern so they can be overrided.
	* sysdeps/mach/hurd/i386/libc.abilist: Update accordingly.
	* sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
---
 ChangeLog                            |  9 +++++++++
 sysdeps/mach/hurd/Versions           | 19 ++++++++++++++-----
 sysdeps/mach/hurd/dl-sysdep.c        |  5 ++++-
 sysdeps/mach/hurd/i386/ld.abilist    |  4 ++++
 sysdeps/mach/hurd/i386/libc.abilist  |  1 +
 sysdeps/mach/hurd/i386/localplt.data |  4 ++--
 6 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5556e82a2d..61edfc5381 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-07-27  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/Versions (libc): Make __access and
+	__access_noerrno external so they can override the ld symbols.
+	(ld): Make __access, __read, __sbrk, __strtoul_internal, __write,
+	__writev, __open64, __access_noerrno extern so they can be overrided.
+	* sysdeps/mach/hurd/i386/libc.abilist: Update accordingly.
+	* sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
+
 2018-07-26  Carlos O'Donell  <carlos@redhat.com>
 
 	* po/libc.pot: Regenerate.
diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions
index 7cab8e8551..f69d5fef67 100644
--- a/sysdeps/mach/hurd/Versions
+++ b/sysdeps/mach/hurd/Versions
@@ -1,11 +1,15 @@
 libc {
   GLIBC_2.0 {
     # functions with a weak definition in the dynamic linker
-    __getcwd; __mmap;
+    __access; __getcwd; __mmap;
+  }
+  GLIBC_2.2.6 {
+    # functions with a weak definition in the dynamic linker
+    __writev;
   }
   GLIBC_PRIVATE {
     # Functions shared with the dynamic linker
-    __libc_read; __libc_write; __libc_lseek64;
+    __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
     __libc_lock_self0;
 
     _dl_init_first;
@@ -18,11 +22,16 @@ ld {
     __hurd_threadvar_stack_mask;  __hurd_threadvar_stack_offset;
 
     # functions that must be shared with libc
-    __close; __getcwd; __getpid;
-    __mmap; __open; __xstat64; __fxstat64;
+    __access; __close; __getcwd; __getpid;
+    __mmap; __open; __read; __sbrk; __strtoul_internal;
+    __write; __writev; __xstat64; __fxstat64;
     _exit; _hurd_intr_rpc_mach_msg;
     abort;
   }
+  GLIBC_2.2 {
+    # functions that must be shared with libc
+    __open64;
+  }
   GLIBC_2.2.6 {
     # this also must be shared with libc.
     __errno_location;
@@ -31,7 +40,7 @@ ld {
     _dl_init_first;
 
     # functions that must be shared with libc
-    __libc_read; __libc_write; __libc_lseek64;
+    __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
     __libc_lock_self0;
   }
 }
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index ec55c47f35..b72913d3ba 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -275,7 +275,10 @@ _dl_sysdep_start_cleanup (void)
 /* Minimal open/close/mmap implementation sufficient for initial loading of
    shared libraries.  These are weak definitions so that when the
    dynamic linker re-relocates itself to be user-visible (for -ldl),
-   it will get the user's definition (i.e. usually libc's).  */
+   it will get the user's definition (i.e. usually libc's).
+
+   They also need to be set in the ld section of sysdeps/mach/hurd/Versions, to
+   be overridable, and in libc.abilist and ld.abilist to be checked. */
 
 /* This macro checks that the function does not get renamed to be hidden: we do
    need these to be overridable by libc's.  */
diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
index 14371336de..3a89b5a10e 100644
--- a/sysdeps/mach/hurd/i386/ld.abilist
+++ b/sysdeps/mach/hurd/i386/ld.abilist
@@ -5,6 +5,10 @@ GLIBC_2.2.6 __getpid F
 GLIBC_2.2.6 __libc_stack_end D 0x4
 GLIBC_2.2.6 __mmap F
 GLIBC_2.2.6 __open F
+GLIBC_2.2.6 __open64 F
+GLIBC_2.2.6 __strtoul_internal F
+GLIBC_2.2.6 __write F
+GLIBC_2.2.6 __writev F
 GLIBC_2.2.6 __xstat64 F
 GLIBC_2.2.6 _dl_mcount F
 GLIBC_2.2.6 _hurd_intr_rpc_mach_msg F
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 9a3aac7a92..64586d828d 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -543,6 +543,7 @@ GLIBC_2.2.6 __wctrans_l F
 GLIBC_2.2.6 __wctype_l F
 GLIBC_2.2.6 __woverflow F
 GLIBC_2.2.6 __write F
+GLIBC_2.2.6 __writev F
 GLIBC_2.2.6 __wuflow F
 GLIBC_2.2.6 __wunderflow F
 GLIBC_2.2.6 __xmknod F
diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
index efcf4e4f6e..69d3a2568d 100644
--- a/sysdeps/mach/hurd/i386/localplt.data
+++ b/sysdeps/mach/hurd/i386/localplt.data
@@ -27,7 +27,7 @@ ld.so: __open64 ?
 ld.so: __close
 ld.so: __read ?
 ld.so: __write ?
-#ld.so: __writev
+ld.so: __writev
 ld.so: __libc_lseek64
 ld.so: __mmap
 ld.so: __fxstat64
@@ -37,7 +37,7 @@ ld.so: __xstat64
 ld.so: __getpid
 #ld.so: __getcwd
 #ld.so: __sbrk
-#ld.so: __strtoul_internal
+ld.so: __strtoul_internal
 #ld.so: _exit
 ld.so: abort
 ld.so: _hurd_intr_rpc_mach_msg
-- 
2.18.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-28 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-28 13:30 [hurd,commited] hurd: Fix some ld.so symbol override from libc Samuel Thibault
  -- strict thread matches above, loose matches on Subject: below --
2018-07-28 13:04 Samuel Thibault
2018-07-27  9:22 Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).