aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/netipx/ipx.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c17
2 files changed, 17 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/netipx/ipx.h b/sysdeps/unix/sysv/linux/netipx/ipx.h
index ec93c81..8a7b6cf 100644
--- a/sysdeps/unix/sysv/linux/netipx/ipx.h
+++ b/sysdeps/unix/sysv/linux/netipx/ipx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
#include <features.h>
#include <sys/types.h>
-#include <sys/socket.h>
+#include <bits/sockaddr.h>
__BEGIN_DECLS
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
index 521ba1a..7e5acc8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
@@ -24,13 +24,26 @@
#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
do { \
char **_tmp; \
+ size_t _test; \
(argc) = *(long *) cookie; \
(argv) = (char **) cookie + 1; \
(envp) = (argv) + (argc) + 1; \
for (_tmp = (envp); *_tmp; ++_tmp) \
continue; \
- (auxp) = (void *) ++_tmp; \
- (auxp) = (void *)(((size_t)(auxp) + 0xF) & 0xFFFFFFF0); \
+ /* The following '++' is important! */ \
+ ++_tmp; \
+ \
+ _test = (size_t)_tmp; \
+ _test = _test + 0xf & ~0xf; \
+ /* Under some circumstances, MkLinux (up to at least DR3a5) \
+ omits the padding. To work around this, we make a \
+ basic sanity check of the argument vector. Of \
+ course, this means that in future, the argument \
+ vector will have to be laid out to allow for this \
+ test :-(. */ \
+ if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
+ _tmp = (char **)_test; \
+ (auxp) = (ElfW(auxv_t) *) _tmp; \
} while (0)