Browse Source

ldso: merge duplicate dl-syscalls.h code to common header

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mike Frysinger 14 years ago
parent
commit
e2f889a746

+ 7 - 0
ldso/include/dl-syscall.h

@@ -8,6 +8,13 @@
 #ifndef _LD_SYSCALL_H_
 #ifndef _LD_SYSCALL_H_
 #define _LD_SYSCALL_H_
 #define _LD_SYSCALL_H_
 
 
+/* We can't use the real errno in ldso, since it has not yet
+ * been dynamicly linked in yet. */
+#include "sys/syscall.h"
+extern int _dl_errno;
+#undef __set_errno
+#define __set_errno(X) {(_dl_errno) = (X);}
+
 /* Pull in the arch specific syscall implementation */
 /* Pull in the arch specific syscall implementation */
 #include <dl-syscalls.h>
 #include <dl-syscalls.h>
 /*  For MAP_ANONYMOUS -- differs between platforms */
 /*  For MAP_ANONYMOUS -- differs between platforms */

+ 0 - 6
ldso/ldso/arm/dl-syscalls.h

@@ -1,9 +1,3 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
 /* _call_via_rX calls are used in thumb ldso because of calls via
 /* _call_via_rX calls are used in thumb ldso because of calls via
  * function pointers, but ldso is not linked with anything which
  * function pointers, but ldso is not linked with anything which
  * provides them, so define them here (only required for thumb).
  * provides them, so define them here (only required for thumb).

+ 1 - 6
ldso/ldso/avr32/dl-syscalls.h

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 0 - 6
ldso/ldso/bfin/dl-syscalls.h

@@ -18,12 +18,6 @@ License along with uClibc; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 USA.  */
 USA.  */
 
 
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
 #include <sys/mman.h>
 #include <sys/mman.h>
 
 
 /* The code below is extracted from libc/sysdeps/linux/frv/_mmap.c */
 /* The code below is extracted from libc/sysdeps/linux/frv/_mmap.c */

+ 0 - 8
ldso/ldso/c6x/dl-syscalls.h

@@ -4,14 +4,6 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
  */
 
 
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
-#include <sys/mman.h>
-
 #ifdef __NR_pread64
 #ifdef __NR_pread64
 #define __NR___syscall_pread __NR_pread64
 #define __NR___syscall_pread __NR_pread64
 static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
 static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,

+ 1 - 6
ldso/ldso/cris/dl-syscalls.h

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 0 - 6
ldso/ldso/frv/dl-syscalls.h

@@ -4,12 +4,6 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
  */
 
 
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
 #include <sys/mman.h>
 #include <sys/mman.h>
 
 
 /* The code below is extracted from libc/sysdeps/linux/frv/_mmap.c */
 /* The code below is extracted from libc/sysdeps/linux/frv/_mmap.c */

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

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

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

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 1 - 6
ldso/ldso/microblaze/dl-syscalls.h

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 1 - 6
ldso/ldso/mips/dl-syscalls.h

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

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

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 0 - 7
ldso/ldso/sh/dl-syscalls.h

@@ -1,10 +1,3 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
-
 #if __GNUC_PREREQ (4, 1)
 #if __GNUC_PREREQ (4, 1)
 #warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
 #warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
 # ifdef __always_inline
 # ifdef __always_inline

+ 0 - 7
ldso/ldso/sh64/dl-syscalls.h

@@ -1,10 +1,3 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
-
 #undef __syscall_return
 #undef __syscall_return
 #define __syscall_return(type, res)					\
 #define __syscall_return(type, res)					\
 do {									\
 do {									\

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

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 1 - 6
ldso/ldso/x86_64/dl-syscalls.h

@@ -1,6 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
+/* stub for arch-specific syscall issues */

+ 1 - 7
ldso/ldso/xtensa/dl-syscalls.h

@@ -1,7 +1 @@
-/* We can't use the real errno in ldso, since it has not yet
- * been dynamicly linked in yet. */
-#include "sys/syscall.h"
-extern int _dl_errno;
-#undef __set_errno
-#define __set_errno(X) {(_dl_errno) = (X);}
-
+/* stub for arch-specific syscall issues */