about summary refs log tree commit diff
path: root/ports/sysdeps/ia64/entry.h
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/ia64/entry.h
parentb7845b638818f32401070f00a61d3b42595ab223 (diff)
downloadglibc-c5abd7ce01539dc5224f7533c9d1048900992317.tar.gz
glibc-c5abd7ce01539dc5224f7533c9d1048900992317.tar.xz
glibc-c5abd7ce01539dc5224f7533c9d1048900992317.zip
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/ia64/entry.h')
-rw-r--r--ports/sysdeps/ia64/entry.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/ports/sysdeps/ia64/entry.h b/ports/sysdeps/ia64/entry.h
index b93e1b6a57..e11b49fc53 100644
--- a/ports/sysdeps/ia64/entry.h
+++ b/ports/sysdeps/ia64/entry.h
@@ -1,10 +1,13 @@
+#include <link.h>
+#include <dl-fptr.h>
+
 #ifndef __ASSEMBLY__
 extern void _start (void);
 #endif
 
 /* The function's entry point is stored in the first word of the
    function descriptor (plabel) of _start().  */
-#define ENTRY_POINT (((long int *) _start)[0])
+#define ENTRY_POINT ELF_PTR_TO_FDESC (_start)->ip
 
 /* We have to provide a special declaration.  */
 #define ENTRY_POINT_DECL(class) class void _start (void);