about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Schmidt <will_schmidt@vnet.ibm.com>2012-01-12 17:05:03 -0500
committerUlrich Drepper <drepper@gmail.com>2012-01-12 17:05:03 -0500
commit929d11c7cf81f4b7cfabc1910a583e6fa5897fd5 (patch)
treeaaf135c1c53ccd0a234032cf9229c8d4f8684c2c
parent0cc5ed3b01cf1dc5d00c15bd9306b727fae9d534 (diff)
downloadglibc-929d11c7cf81f4b7cfabc1910a583e6fa5897fd5.tar.gz
glibc-929d11c7cf81f4b7cfabc1910a583e6fa5897fd5.tar.xz
glibc-929d11c7cf81f4b7cfabc1910a583e6fa5897fd5.zip
Powerpc: correct duplicate label issue with multiple passes through context code
-rw-r--r--ChangeLog8
-rw-r--r--sysdeps/powerpc/powerpc32/sysdep.h8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S3
5 files changed, 25 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f8767e07b..c7cba4e8e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-01-04  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+	* powerpc/powerpc32/sysdep.h: Add GLUE and GENERATE_GOT_LABEL macros.
+	* unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Call
+	macro to ensure uniqueness of label name.
+	* unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Likewise.
+	* unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Likewise.
+
 2012-01-11  Ulrich Drepper  <drepper@gmail.com>
 
 	* sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c: New file.
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index c824c0a85d..eb04afbcd6 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -1,5 +1,5 @@
 /* Assembly macros for 32-bit PowerPC.
-   Copyright (C) 1999, 2001, 2002, 2003, 2006, 2011
+   Copyright (C) 1999, 2001, 2002, 2003, 2006, 2011, 2012
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -93,7 +93,7 @@ GOT_LABEL:			;					      \
   ASM_SIZE_DIRECTIVE(name)
 
 #define DO_CALL(syscall)				      		      \
-    li 0,syscall;						              \
+    li 0,syscall;							      \
     sc
 
 #undef JUMPTARGET
@@ -153,6 +153,10 @@ GOT_LABEL:			;					      \
 #undef L
 #define L(x) .L##x
 
+#define XGLUE(a,b) a##b
+#define GLUE(a,b) XGLUE (a,b)
+#define GENERATE_GOT_LABEL(name) GLUE (.got_label, name)
+
 /* Label in text section.  */
 #define C_TEXT(name) name
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
index f55c0730f1..e609f802e3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
@@ -1,5 +1,5 @@
 /* Save current context, powerpc32 common.
-   Copyright (C) 2005, 2006, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2011, 2012 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
@@ -18,13 +18,13 @@
    02110-1301 USA.  */
 
 /* This is the common implementation of getcontext for powerpc32.
-   It not complete in itself should be included in to a framework that 
+   It not complete in itself should be included in to a framework that
    defines:
      __CONTEXT_FUNC_NAME
    and if appropriate:
      __CONTEXT_ENABLE_FPRS
      __CONTEXT_ENABLE_VRS
-   Any archecture that implements the Vector unit is assumed to also 
+   Any archecture that implements the Vector unit is assumed to also
    implement the floating unit.  */
 
 /* Stack frame offsets.  */
@@ -145,6 +145,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 # ifdef __CONTEXT_ENABLE_VRS
 #  ifdef PIC
 	mflr    r8
+#  define got_label GENERATE_GOT_LABEL (__CONTEXT_FUNC_NAME)
 	SETUP_GOT_ACCESS(r7,got_label)
 	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
 	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l
@@ -165,9 +166,9 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 	la	r10,(_UC_VREGS)(r3)
 	la	r9,(_UC_VREGS+16)(r3)
-	
+
 	beq	2f	/* L(no_vec) */
-/* address of the combined VSCR/VSAVE quadword.  */	
+/* address of the combined VSCR/VSAVE quadword.  */
 	la	r8,(_UC_VREGS+512)(r3)
 
 /* Save the vector registers */
@@ -186,7 +187,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	addi  r9,r9,32
 
 	stvx	v0,0,r8
-	
+
 	stvx  v4,0,r10
 	stvx  v5,0,r9
 	addi  r10,r10,32
@@ -277,4 +278,3 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	mtlr	r0
 	blr
 END(__CONTEXT_FUNC_NAME)
-
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index a2f419b0e1..f7ce4c662a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -1,5 +1,5 @@
 /* Jump to a new context powerpc32 common.
-   Copyright (C) 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008, 2009, 2011, 2012 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
@@ -73,6 +73,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 #ifdef PIC
 	mflr    r8
+# define got_label GENERATE_GOT_LABEL (__CONTEXT_FUNC_NAME)
 	SETUP_GOT_ACCESS(r7,got_label)
 	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
 	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 19dfcf8402..f571a82f8e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -1,5 +1,5 @@
 /* Save current context and jump to a new context.
-   Copyright (C) 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2005,2006,2008,2009,2011,2012 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
@@ -146,6 +146,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 # ifdef PIC
 	mflr    r8
+#  define got_label GENERATE_GOT_LABEL (__CONTEXT_FUNC_NAME)
 	SETUP_GOT_ACCESS(r7,got_label)
 	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
 	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l