aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/sysdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/sysdep.h')
-rw-r--r--sysdeps/i386/sysdep.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h
index 2c0aafa..1dbb8e1 100644
--- a/sysdeps/i386/sysdep.h
+++ b/sysdeps/i386/sysdep.h
@@ -20,10 +20,23 @@
#include <sysdeps/generic/sysdep.h>
-#ifdef __ASSEMBLER__
-# define GET_PC_THUNK(reg) __i686.get_pc_thunk.reg
+#include <features.h> /* For __GNUC_PREREQ. */
+
+/* It is desirable that the names of PIC thunks match those used by
+ GCC so that multiple copies are eliminated by the linker. */
+
+#ifdef __ASSEMBLER__
+# if __GNUC_PREREQ (4, 7)
+# define GET_PC_THUNK(reg) __x86.get_pc_thunk.reg
+# else
+# define GET_PC_THUNK(reg) __i686.get_pc_thunk.reg
+# endif
#else
-# define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg
+# if __GNUC_PREREQ (4, 7)
+# define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg
+# else
+# define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg
+# endif
#endif
#ifdef __ASSEMBLER__