Description: Fix name of PIC thunks with gcc 4.7
Origin: vendor
Bug-Debian: http://bugs.debian.org/683925
Forwarded: no
Author: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2012-09-16

--- a/devw/dwmixfa_8087.c
+++ b/devw/dwmixfa_8087.c
@@ -171,7 +171,12 @@
 /* store pointer to dwmixfa_state into EBX. Non PIC code already has this in place from stub */
 		"pushl %%ebx\n"
 
-		"call __i686.get_pc_thunk.bx\n"
+#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
+		"call " GET_PC_THUNK_STR(reg) " \n"
 		"addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n"
 		"movl dwmixfa_state@GOT(%%ebx), %%ebx\n"
 #endif
@@ -249,7 +254,7 @@
 	(
 #ifdef __PIC__
 		"pushl %%ebx\n"
-		"call __i686.get_pc_thunk.bx\n"
+		"call " GET_PC_THUNK_STR(reg) "\n"
 		"addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n"
 		"pushl %%ebx\n"
 		"movl dwmixfa_state@GOT(%%ebx), %%ebx\n"
@@ -2264,7 +2269,7 @@
 	 */
 #ifdef __PIC__
 		"pushl %%ebx\n"
-		"call __i686.get_pc_thunk.bx\n"
+		"call " GET_PC_THUNK_STR(reg) " \n"
 		"addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n"
 		"movl dwmixfa_state@GOT(%%ebx), %%ebx\n"
 #else
