summaryrefslogtreecommitdiff
path: root/ports/sysdeps/unix/sysv/linux/ia64
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-03-10 11:49:29 +0000
committerMike Frysinger <vapier@gentoo.org>2013-03-12 06:00:05 -0400
commitc5abd7ce01539dc5224f7533c9d1048900992317 (patch)
treecca3fe48d201c7078fd530f55913ce9ce01eec83 /ports/sysdeps/unix/sysv/linux/ia64
parentb7845b638818f32401070f00a61d3b42595ab223 (diff)
downloadglibc-c5abd7ce01539dc5224f7533c9d1048900992317.tar.gz
ia64: fix strict aliasing warnings with func descriptors
Function pointers on ia64 are like parisc -- they're plabels. While the parisc port enjoys a gcc builtin for extracting the address here, ia64 has no such luck. Casting & dereferencing in one go triggers a strict aliasing warning. Use a union to fix that. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'ports/sysdeps/unix/sysv/linux/ia64')
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/makecontext.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c b/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c
index a512c94097..c3bb5de197 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c
+++ b/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c
@@ -22,14 +22,10 @@
#include <stdlib.h>
#include <ucontext.h>
#include <sys/rse.h>
+#include <link.h>
+#include <dl-fptr.h>
-struct fdesc
- {
- unsigned long ip;
- unsigned long gp;
- };
-
#define PUSH(val) \
do { \
if (ia64_rse_is_rnat_slot (rbs)) \
@@ -65,16 +61,16 @@ makecontext: does not know how to handle more than 8 arguments\n"));
}
/* set the entry point and global pointer: */
- sc->sc_br[0] = ((struct fdesc *) &__start_context)->ip;
- sc->sc_br[1] = ((struct fdesc *) func)->ip;
- sc->sc_gr[1] = ((struct fdesc *) func)->gp;
+ sc->sc_br[0] = ELF_PTR_TO_FDESC (&__start_context)->ip;
+ sc->sc_br[1] = ELF_PTR_TO_FDESC (func)->ip;
+ sc->sc_gr[1] = ELF_PTR_TO_FDESC (func)->gp;
/* set up the call frame: */
sc->sc_ar_pfs = ((sc->sc_ar_pfs & ~0x3fffffffffUL)
| (argc + 2) | ((argc + 2) << 7));
rbs = (unsigned long *) stack_start;
PUSH((long) ucp->uc_link);
- PUSH(((struct fdesc *) &__start_context)->gp);
+ PUSH(ELF_PTR_TO_FDESC (&__start_context)->gp);
va_start (ap, argc);
for (i = 0; i < argc; ++i)
PUSH(va_arg (ap, long));