summaryrefslogtreecommitdiff
path: root/ldso/ldso/ld_syscall.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-08 14:35:49 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-08 14:35:49 +0000
commit9cba52f0aedbb95671e8a14e3fd5ff98381ff2b0 (patch)
treedd82b29998103d7d8ba34351e6fc3a12dc0ed7ac /ldso/ldso/ld_syscall.h
parent4c69b9f793fc1eae9190d8ba26dba25db616272f (diff)
Patch from Stefan Allius and Edie C. Dost to add SuperH
shared library support. This also adds some cleaner error handling, which I (Erik) then ported over to x86 and arm. In addition Stefan added the following fixes: - in hash.c was the lvalue handling of global library functions wrong. To fix this I had to change the prototype of _dl_find_hash. (==> TIS and ELF spec. Vers. 1.2) - in ldso.c was the order of the .init sections calls wrong. Before we call the initialization code of a library we have to check that all dependend libraries are already initialized. This can easily made by calling it in the revers loading order. For this I added a previous pointer chain. - in ldso.c the ELF magics wasn't checked fo PPC, MIPS and SH architecture
Diffstat (limited to 'ldso/ldso/ld_syscall.h')
-rw-r--r--ldso/ldso/ld_syscall.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/ldso/ldso/ld_syscall.h b/ldso/ldso/ld_syscall.h
index 386756d05..94048cdbd 100644
--- a/ldso/ldso/ld_syscall.h
+++ b/ldso/ldso/ld_syscall.h
@@ -51,8 +51,8 @@ static inline _syscall1(void, _dl_exit, int, status);
static inline _syscall1(int, _dl_close, int, fd);
-#if defined(__powerpc) || defined(__mips__)
-/* PowerPC and MIPS have a different calling convention for mmap(). */
+#if defined(__powerpc) || defined(__mips__) || defined(__sh__)
+/* PowerPC, MIPS and SuperH have a different calling convention for mmap(). */
#define __NR__dl_mmap __NR_mmap
static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length,
int, prot, int, flags, int, fd, off_t, offset);
@@ -91,6 +91,9 @@ static inline void * _dl_mmap(void * addr, unsigned long size, int prot,
#define __NR__dl_open __NR_open
#define O_RDONLY 0x0000
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
static inline _syscall2(int, _dl_open, const char *, fn, int, flags);
#define __NR__dl_write __NR_write
@@ -126,6 +129,9 @@ static inline _syscall0(gid_t, _dl_getgid);
#define __NR__dl_getegid __NR_getegid
static inline _syscall0(gid_t, _dl_getegid);
+#define __NR__dl_getpid __NR_getpid
+static inline _syscall0(gid_t, _dl_getpid);
+
/*
* Not an actual syscall, but we need something in assembly to say whether
* this is OK or not.