瀏覽代碼

Cleanup header files a bit.
-Erik

Eric Andersen 23 年之前
父節點
當前提交
2aed5b3bb0

+ 1 - 2
ldso/ldso/arm/dl-syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -16,6 +14,7 @@
 #define __NR_geteuid			(__NR_SYSCALL_BASE+ 49)
 #define __NR_getgid			(__NR_SYSCALL_BASE+ 47)
 #define __NR_getegid			(__NR_SYSCALL_BASE+ 50)
+#define __NR_readlink			(__NR_SYSCALL_BASE+ 85)
 #define __NR_mmap			(__NR_SYSCALL_BASE+ 90)
 #define __NR_munmap			(__NR_SYSCALL_BASE+ 91)
 #define __NR_stat			(__NR_SYSCALL_BASE+106)

+ 1 - 2
ldso/ldso/arm/ld_syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -16,6 +14,7 @@
 #define __NR_geteuid			(__NR_SYSCALL_BASE+ 49)
 #define __NR_getgid			(__NR_SYSCALL_BASE+ 47)
 #define __NR_getegid			(__NR_SYSCALL_BASE+ 50)
+#define __NR_readlink			(__NR_SYSCALL_BASE+ 85)
 #define __NR_mmap			(__NR_SYSCALL_BASE+ 90)
 #define __NR_munmap			(__NR_SYSCALL_BASE+ 91)
 #define __NR_stat			(__NR_SYSCALL_BASE+106)

+ 1 - 0
ldso/ldso/i386/dl-syscalls.h

@@ -12,6 +12,7 @@
 #define __NR_geteuid		 49
 #define __NR_getgid		 47
 #define __NR_getegid		 50
+#define __NR_readlink		 85
 #define __NR_mmap		 90
 #define __NR_munmap		 91
 #define __NR_stat		106

+ 1 - 0
ldso/ldso/i386/ld_syscalls.h

@@ -12,6 +12,7 @@
 #define __NR_geteuid		 49
 #define __NR_getgid		 47
 #define __NR_getegid		 50
+#define __NR_readlink		 85
 #define __NR_mmap		 90
 #define __NR_munmap		 91
 #define __NR_stat		106

+ 1 - 1
ldso/ldso/ld_hash.h

@@ -1,7 +1,7 @@
 #ifndef _HASH_H_
 #define _HASH_H_
 
-#include <elf.h>
+#include "linuxelf.h"
 
 /* Header file that describes the internal data structures used by the
  * ELF dynamic linker.  */

+ 29 - 2
ldso/ldso/ld_syscall.h

@@ -1,13 +1,38 @@
+/* Pull in compiler and arch stuff */
+#include <stdarg.h>
 /* Pull in the arch specific type information */
 #include <sys/types.h>
 /* Pull in the arch specific syscall implementation */
 #include "ld_syscalls.h"
 /*  For MAP_ANONYMOUS -- differs between platforms */
-#include <sys/mman.h>			
+#include <asm/mman.h>			
 /* Pull in whatever this particular arch's kernel thinks the kernel version of
  * struct stat should look like.  It turns out that each arch has a different
  * opinion on the subject, and different kernel revs use different names... */
-#include <sys/stat.h> 
+#define _SYS_STAT_H
+#include <asm/stat.h> 
+
+
+/* Encoding of the file mode.  */
+#define	S_IFMT		0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	S_IFDIR		0040000	/* Directory.  */
+#define	S_IFCHR		0020000	/* Character device.  */
+#define	S_IFBLK		0060000	/* Block device.  */
+#define	S_IFREG		0100000	/* Regular file.  */
+#define	S_IFIFO		0010000	/* FIFO.  */
+#define	S_IFLNK		0120000	/* Symbolic link.  */
+#define	S_IFSOCK	0140000	/* Socket.  */
+
+/* Protection bits.  */
+
+#define	S_ISUID		04000	/* Set user ID on execution.  */
+#define	S_ISGID		02000	/* Set group ID on execution.  */
+#define	S_ISVTX		01000	/* Save swapped text after use (sticky).  */
+#define	S_IREAD		0400	/* Read by owner.  */
+#define	S_IWRITE	0200	/* Write by owner.  */
+#define	S_IEXEC		0100	/* Execute by owner.  */
 
 
 /* Here are the definitions for some syscalls that are used
@@ -120,3 +145,5 @@ static inline int _dl_suid_ok(void)
 	return 0;
 }
 
+#define __NR__dl_readlink __NR_readlink
+static inline _syscall3(int, _dl_readlink, const char *, path, char *, buf, size_t, bufsiz);

+ 1 - 2
ldso/ldso/m68k/dl-syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -14,6 +12,7 @@
 #define __NR_geteuid		 49
 #define __NR_getgid		 47
 #define __NR_getegid		 50
+#define __NR_readlink		 85
 #define __NR_mmap		 90
 #define __NR_munmap		 91
 #define __NR_stat		106

+ 1 - 2
ldso/ldso/m68k/ld_syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -14,6 +12,7 @@
 #define __NR_geteuid		 49
 #define __NR_getgid		 47
 #define __NR_getegid		 50
+#define __NR_readlink		 85
 #define __NR_mmap		 90
 #define __NR_munmap		 91
 #define __NR_stat		106

+ 1 - 2
ldso/ldso/powerpc/dl-syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -14,6 +12,7 @@
 #define __NR_geteuid		 49
 #define __NR_getgid		 47
 #define __NR_getegid		 50
+#define __NR_readlink		 85
 #define __NR_mmap		 90
 #define __NR_munmap		 91
 #define __NR_stat		106

+ 1 - 2
ldso/ldso/powerpc/ld_syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -14,6 +12,7 @@
 #define __NR_geteuid		 49
 #define __NR_getgid		 47
 #define __NR_getegid		 50
+#define __NR_readlink		 85
 #define __NR_mmap		 90
 #define __NR_munmap		 91
 #define __NR_stat		106

+ 1 - 2
ldso/ldso/sparc/dl-syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -14,6 +12,7 @@
 #define __NR_getgid		 47
 #define __NR_geteuid		 49
 #define __NR_getegid		 50
+#define __NR_readlink            58
 #define __NR_mmap		 71
 #define __NR_munmap		 73
 #define __NR_stat		 38

+ 1 - 2
ldso/ldso/sparc/ld_syscalls.h

@@ -1,5 +1,3 @@
-#include <sys/types.h>
-
 /*
  * This file contains the system call macros and syscall 
  * numbers used by the shared library loader.
@@ -14,6 +12,7 @@
 #define __NR_getgid		 47
 #define __NR_geteuid		 49
 #define __NR_getegid		 50
+#define __NR_readlink            58
 #define __NR_mmap		 71
 #define __NR_munmap		 73
 #define __NR_stat		 38

+ 0 - 8
ldso/ldso/sparc/sdiv.S

@@ -38,15 +38,7 @@
 
 
 #include "DEFS.h"
-#ifndef __linux__
-#ifdef __svr4__
-#include <sys/trap.h>
-#else
-#include "/usr/include/machine/trap.h"
-#endif
-#else
 #include <asm/traps.h>
-#endif
 
 FUNC(_dl_div)
 	! compute sign of result; if neither is negative, no problem

+ 0 - 8
ldso/ldso/sparc/udiv.S

@@ -37,15 +37,7 @@
 
 
 #include "DEFS.h"
-#ifndef __linux__
-#ifdef __svr4__
-#include <sys/trap.h>
-#else
-#include "/usr/include/machine/trap.h"
-#endif
-#else
 #include <asm/traps.h>
-#endif
 
 FUNC(_dl_udiv)
 

+ 0 - 8
ldso/ldso/sparc/urem.S

@@ -38,15 +38,7 @@
 
 
 #include "DEFS.h"
-#ifdef __linux__
 #include <asm/traps.h>
-#else
-#ifdef __svr4__
-#include <sys/trap.h>
-#else
-#include "/usr/include/machine/trap.h"
-#endif
-#endif
 
 FUNC(_dl_urem)