summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-09-25 06:57:04 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-09-25 06:57:04 +0000
commit4fc130695b83b70c2418fbec6673b198e612a3cd (patch)
tree56510ca99bf44beccf898e832cf33226ef44388f /libexec
parentb65cbbd89ac9082171e8c9b867e5decabe61c582 (diff)
Do mmap the right way.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/sparc64/archdep.h11
-rw-r--r--libexec/ld.so/sparc64/ldasm.S11
-rw-r--r--libexec/ld.so/sparc64/syscall.h5
3 files changed, 18 insertions, 9 deletions
diff --git a/libexec/ld.so/sparc64/archdep.h b/libexec/ld.so/sparc64/archdep.h
index fffedcce259..3ddd8b3c92c 100644
--- a/libexec/ld.so/sparc64/archdep.h
+++ b/libexec/ld.so/sparc64/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.3 2001/09/24 23:40:10 art Exp $ */
+/* $OpenBSD: archdep.h,v 1.4 2001/09/25 06:57:03 art Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -45,6 +45,7 @@
#include <elf_abi.h>
#include <machine/exec.h>
#include <machine/reloc.h>
+#include <sys/syscall.h>
int _dl_write __P((int, const char *, int));
@@ -126,6 +127,14 @@ _dl_strchr(const char *p, const int c)
return(0);
}
+static inline long
+_dl_mmap(void *addr, unsigned int len, unsigned int prot,
+ unsigned int flags, int fd, off_t offset)
+{
+ return(_dl___syscall((quad_t)SYS_mmap, addr, len, prot,
+ flags, fd, 0, offset));
+}
+
static inline void
RELOC_RELA(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
{
diff --git a/libexec/ld.so/sparc64/ldasm.S b/libexec/ld.so/sparc64/ldasm.S
index 8768fdec6ed..53f1713080f 100644
--- a/libexec/ld.so/sparc64/ldasm.S
+++ b/libexec/ld.so/sparc64/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.6 2001/09/25 06:34:31 art Exp $ */
+/* $OpenBSD: ldasm.S,v 1.7 2001/09/25 06:57:03 art Exp $ */
/* $NetBSD: rtld_start.S,v 1.5 2001/08/14 22:17:48 eeh Exp $ */
/*
@@ -300,15 +300,16 @@ _dl_getuid:
.section ".text"
.align 4
- .global _dl_mmap
- .type _dl_mmap,@function
-_dl_mmap:
- mov SYS_mmap | SYSCALL_G2RFLAG, %g1 ! calling sys_mmap
+ .global _dl___syscall
+ .type _dl___syscall,@function
+_dl___syscall:
+ mov SYS___syscall | SYSCALL_G2RFLAG, %g1 ! call sys_exit
add %o7, 8, %g2 ! just return on sucess
t ST_SYSCALL ! off to wonderland
retl
sub %g0, %o0, %o0 ! error: result = -errno
+
.section ".text"
.align 4
.global _dl_munmap
diff --git a/libexec/ld.so/sparc64/syscall.h b/libexec/ld.so/sparc64/syscall.h
index 151edc2bdee..52d6f7a85b3 100644
--- a/libexec/ld.so/sparc64/syscall.h
+++ b/libexec/ld.so/sparc64/syscall.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.h,v 1.1 2001/09/21 14:54:19 jason Exp $ */
+/* $OpenBSD: syscall.h,v 1.2 2001/09/25 06:57:03 art Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -48,8 +48,7 @@ int _dl_getegid __P((void));
int _dl_geteuid __P((void));
int _dl_getgid __P((void));
int _dl_getuid __P((void));
-long _dl_mmap __P((void *, unsigned int, unsigned int, unsigned int, int,
- off_t));
+long _dl___syscall(quad_t, ...);
int _dl_mprotect __P((const void *, int, int));
int _dl_munmap __P((const void*, unsigned int));
int _dl_open __P((const char*, unsigned int));