]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Fix build after __pread64 usage in the dynamic loader
authorFlorian Weimer <fweimer@redhat.com>
Thu, 24 Oct 2019 13:51:29 +0000 (15:51 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 24 Oct 2019 13:51:29 +0000 (15:51 +0200)
Commit 95c1056962a3f2297c94ce47f0eaf0c5b6563231 ("elf: Use nocancel
pread64() instead of lseek()+read()") added calls to __pread64 to
the dynamic loader.  On Hurd, this needs an implementation in the
dynamic loader because the rtld-pread64 rebuild pulls in too many
symbols.

Fixes: 95c1056962a3f2297c94ce47f0eaf0c5b6563231
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
sysdeps/mach/hurd/dl-sysdep.c

index 219475aa7d7ecb51156c53b6c9c3e7863041c219..719d603f446aaa7f7b477b0cf8ab5d6260a5b15a 100644 (file)
@@ -357,9 +357,9 @@ __close (int fd)
   return 0;
 }
 
-check_no_hidden(__read);
+check_no_hidden(__pread64);
 __ssize_t weak_function
-__read (int fd, void *buf, size_t nbytes)
+__pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
 {
   error_t err;
   char *data;
@@ -367,7 +367,7 @@ __read (int fd, void *buf, size_t nbytes)
 
   data = buf;
   nread = nbytes;
-  err = __io_read ((mach_port_t) fd, &data, &nread, -1, nbytes);
+  err = __io_read ((mach_port_t) fd, &data, &nread, offset, nbytes);
   if (err)
     return __hurd_fail (err);
 
@@ -379,6 +379,14 @@ __read (int fd, void *buf, size_t nbytes)
 
   return nread;
 }
+libc_hidden_weak (__pread64)
+
+check_no_hidden(__read);
+__ssize_t weak_function
+__read (int fd, void *buf, size_t nbytes)
+{
+  return __pread64 (fd, buf, nbytes, -1);
+}
 libc_hidden_weak (__read)
 
 check_no_hidden(__write);