about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/fpu/s_fma.S2
-rw-r--r--sysdeps/powerpc/fpu/s_fmaf.S2
-rw-r--r--sysdeps/powerpc/powerpc32/sysdep.h2
-rw-r--r--sysdeps/powerpc/powerpc64/a2/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/addmul_1.S2
-rw-r--r--sysdeps/powerpc/powerpc64/cell/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/dl-trampoline.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_ceil.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_ceilf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_copysign.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_copysignl.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fabsl.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_floor.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_floorf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_llrint.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_llrintf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_rint.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_rintf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_round.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_roundf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_trunc.S2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_truncf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/lshift.S2
-rw-r--r--sysdeps/powerpc/powerpc64/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/memset.S2
-rw-r--r--sysdeps/powerpc/powerpc64/mul_1.S2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S19
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power4/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power6/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power6/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/add_n.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memmove.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power7/mempcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memrchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power7/rawmemchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strcasecmp.S3
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strchrnul.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strlen.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strncpy.S6
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strnlen.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strrchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strstr.S3
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcasestr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strlen.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strncpy.S6
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strnlen.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strrchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strspn.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power9/strcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power9/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/ppc-mcount.S4
-rw-r--r--sysdeps/powerpc/powerpc64/start.S4
-rw-r--r--sysdeps/powerpc/powerpc64/strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/strcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/strlen.S2
-rw-r--r--sysdeps/powerpc/powerpc64/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/sysdep.h65
102 files changed, 172 insertions, 138 deletions
diff --git a/sysdeps/powerpc/fpu/s_fma.S b/sysdeps/powerpc/fpu/s_fma.S
index e101f374bf..19d2717f51 100644
--- a/sysdeps/powerpc/fpu/s_fma.S
+++ b/sysdeps/powerpc/fpu/s_fma.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-ENTRY(__fma)
+ENTRY_TOCLESS(__fma)
 /* double [f1] fma (double [f1] x, double [f2] y, double [f3] z); */
 	fmadd	fp1,fp1,fp2,fp3
 	blr
diff --git a/sysdeps/powerpc/fpu/s_fmaf.S b/sysdeps/powerpc/fpu/s_fmaf.S
index 49ea298707..2b844e7937 100644
--- a/sysdeps/powerpc/fpu/s_fmaf.S
+++ b/sysdeps/powerpc/fpu/s_fmaf.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-ENTRY(__fmaf)
+ENTRY_TOCLESS(__fmaf)
 /* float [f1] fmaf (float [f1] x, float [f2] y, float [f3] z); */
 	fmadds	fp1,fp1,fp2,fp3
 	blr
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index f92ab2cded..965ea43c94 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -43,6 +43,8 @@
   cfi_startproc;							      \
   CALL_MCOUNT
 
+#define ENTRY_TOCLESS(name) ENTRY(name)
+
 /* helper macro for accessing the 32-bit powerpc GOT. */
 
 #define	SETUP_GOT_ACCESS(regname,GOT_LABEL)				      \
diff --git a/sysdeps/powerpc/powerpc64/a2/memcpy.S b/sysdeps/powerpc/powerpc64/a2/memcpy.S
index ff30898df5..26846dcf68 100644
--- a/sysdeps/powerpc/powerpc64/a2/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/a2/memcpy.S
@@ -34,7 +34,7 @@
 
 
 	.machine  a2
-EALIGN (MEMCPY, 5, 0)
+ENTRY (MEMCPY, 5)
 	CALL_MCOUNT 3
 
 	dcbt    0,r4            /* Prefetch ONE SRC cacheline  */
diff --git a/sysdeps/powerpc/powerpc64/addmul_1.S b/sysdeps/powerpc/powerpc64/addmul_1.S
index b4b052141d..f463765e8b 100644
--- a/sysdeps/powerpc/powerpc64/addmul_1.S
+++ b/sysdeps/powerpc/powerpc64/addmul_1.S
@@ -34,7 +34,7 @@
 #define N   r5
 #define VL  r6
 
-EALIGN(FUNC, 5, 0)
+ENTRY_TOCLESS (FUNC, 5)
 	std	r31, -8(r1)
 	rldicl.	r0, N, 0, 62
 	std	r30, -16(r1)
diff --git a/sysdeps/powerpc/powerpc64/cell/memcpy.S b/sysdeps/powerpc/powerpc64/cell/memcpy.S
index 1cc66456e3..6e7f2b1f8f 100644
--- a/sysdeps/powerpc/powerpc64/cell/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/cell/memcpy.S
@@ -43,7 +43,7 @@
 
 .align  7
 
-EALIGN (MEMCPY, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
 	CALL_MCOUNT 3
 
 	dcbt	0,r4		/* Prefetch ONE SRC cacheline  */
diff --git a/sysdeps/powerpc/powerpc64/dl-trampoline.S b/sysdeps/powerpc/powerpc64/dl-trampoline.S
index 5ec729d1f4..7ceb62b1cf 100644
--- a/sysdeps/powerpc/powerpc64/dl-trampoline.S
+++ b/sysdeps/powerpc/powerpc64/dl-trampoline.S
@@ -33,7 +33,7 @@
    a function that makes no calls except for __tls_get_addr and we
    might be here resolving the __tls_get_addr call.  */
 #define INT_PARMS FRAME_MIN_SIZE
-EALIGN(_dl_runtime_resolve, 4, 0)
+ENTRY (_dl_runtime_resolve, 4)
 	stdu	r1,-FRAME_SIZE(r1)
 	cfi_adjust_cfa_offset (FRAME_SIZE)
 	std	r3,INT_PARMS+0(r1)
@@ -195,7 +195,7 @@ END(_dl_runtime_resolve)
    parm1 (r3) and the index (r0) needs to be converted to an offset
    (index * 24) in parm2 (r4).  */
 #ifndef PROF
-EALIGN(_dl_profile_resolve, 4, 0)
+ENTRY (_dl_profile_resolve, 4)
 /* Spill r30, r31 to preserve the link_map* and reloc_addr, in case we
    need to call _dl_call_pltexit.  */
 	std	r31,-8(r1)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/fpu/s_ceil.S
index 78d7feefed..ce673e51f0 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_ceil.S
@@ -24,7 +24,7 @@
 	.tc FD_43300000_0[TC],0x4330000000000000
 	.section	".text"
 
-EALIGN (__ceil, 4, 0)
+ENTRY (__ceil, 4)
 	CALL_MCOUNT 0
 	lfd	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
index bc5ab02cb0..ee62d8a84d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
@@ -25,7 +25,7 @@
 	.long 0x0
 	.section	".text"
 
-EALIGN (__ceilf, 4, 0)
+ENTRY (__ceilf, 4)
 	CALL_MCOUNT 0
 	lfs	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
index 59472816c7..0dd9ce03da 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
@@ -22,7 +22,7 @@
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
 
-ENTRY(__copysign)
+ENTRY_TOCLESS (__copysign)
 	CALL_MCOUNT 0
 /* double [f1] copysign (double [f1] x, double [f2] y);
    copysign(x,y) returns a value with the magnitude of x and
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
index b33ea6e256..ea0c2489ab 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
 
-ENTRY(__copysignl)
+ENTRY_TOCLESS (__copysignl)
 /* long double [f1,f2] copysign (long double [f1,f2] x, long double [f3,f4] y);
    copysign(x,y) returns a value with the magnitude of x and
    with the sign bit of y.  */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S b/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S
index 7603abba5d..b712e629c7 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
 
-ENTRY(__fabsl)
+ENTRY_TOCLESS (__fabsl)
 /* long double [f1,f2] fabs (long double [f1,f2] x);
    fabs(x,y) returns a value with the magnitude of x and
    with the sign bit of y.  */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_floor.S b/sysdeps/powerpc/powerpc64/fpu/s_floor.S
index 4a6cc0ebba..23cea2ab5a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_floor.S
@@ -24,7 +24,7 @@
 	.tc FD_43300000_0[TC],0x4330000000000000
 	.section	".text"
 
-EALIGN (__floor, 4, 0)
+ENTRY (__floor, 4)
 	CALL_MCOUNT 0
 	lfd	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
index d8b5e21248..defcab4dfa 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
@@ -25,7 +25,7 @@
 	.long 0x0
 	.section	".text"
 
-EALIGN (__floorf, 4, 0)
+ENTRY (__floorf, 4)
 	CALL_MCOUNT 0
 	lfs	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
index 6cba2d4408..0ea05a0c3a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
@@ -21,7 +21,7 @@
 
 /* int __isnan(x)  */
 	.machine power4
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
 	CALL_MCOUNT 0
 	mffs	fp0
 	mtfsb0	4*cr6+lt /* reset_fpscr_bit (FPSCR_VE) */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/fpu/s_llrint.S
index 39e765434a..6893285fbb 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llrint.S
@@ -20,7 +20,7 @@
 #include <math_ldbl_opt.h>
 
 /* long long int[r3] __llrint (double x[fp1])  */
-ENTRY (__llrint)
+ENTRY_TOCLESS (__llrint)
 	CALL_MCOUNT 0
 	fctid	fp13,fp1
 	stfd	fp13,-16(r1)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
index 4050be6437..95d437e54d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
@@ -19,7 +19,7 @@
 #include <sysdep.h>
 
 /* long long int[r3] __llrintf (float x[fp1])  */
-ENTRY (__llrintf)
+ENTRY_TOCLESS (__llrintf)
 	CALL_MCOUNT 0
 	fctid	fp13,fp1
 	stfd	fp13,-16(r1)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
index 3dcd04b1f3..88ec253ced 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
@@ -31,7 +31,7 @@
 	.tc FD_43300000_0[TC],0x4330000000000000
 	.section	".text"
 
-EALIGN (__nearbyint, 4, 0)
+ENTRY (__nearbyint, 4)
 	CALL_MCOUNT 0
 	fabs	fp0,fp1
 	lfd	fp13,.LC0@toc(2)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
index 11be35f94e..36212e103e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
@@ -32,7 +32,7 @@
 	.long 0x0
 	.section	".text"
 
-EALIGN (__nearbyintf, 4, 0)
+ENTRY (__nearbyintf, 4)
 	CALL_MCOUNT 0
 	fabs	fp0,fp1
 	lfs	fp13,.LC0@toc(2)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_rint.S b/sysdeps/powerpc/powerpc64/fpu/s_rint.S
index 7ba0adff84..3543279ed4 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_rint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_rint.S
@@ -27,7 +27,7 @@
 	.tc FD_43300000_0[TC],0x4330000000000000
 	.section	".text"
 
-EALIGN (__rint, 4, 0)
+ENTRY (__rint, 4)
 	CALL_MCOUNT 0
 	lfd	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_rintf.S b/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
index b1d1e158c0..193cf81368 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
@@ -25,7 +25,7 @@
 	.long 0x0
 	.section	".text"
 
-EALIGN (__rintf, 4, 0)
+ENTRY (__rintf, 4)
 	CALL_MCOUNT 0
 	lfs	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_round.S b/sysdeps/powerpc/powerpc64/fpu/s_round.S
index fe315af51d..d10c74d037 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_round.S
@@ -36,7 +36,7 @@
    "Round toward Zero" mode and round by adding +-0.5 before rounding
    to the integer value.  */
 
-EALIGN (__round, 4, 0)
+ENTRY (__round, 4)
 	CALL_MCOUNT 0
 	lfd	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
index d213f43566..18c39d54d8 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
@@ -37,7 +37,7 @@
    "Round toward Zero" mode and round by adding +-0.5 before rounding
    to the integer value.  */
 
-EALIGN (__roundf, 4, 0)
+ENTRY (__roundf, 4)
 	CALL_MCOUNT 0
 	lfs	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
index 890eb21c54..1e356dee7d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
@@ -31,7 +31,7 @@
    We set "round toward Zero" mode and trunc by adding +-2**52 then
    subtracting +-2**52.  */
 
-EALIGN (__trunc, 4, 0)
+ENTRY (__trunc, 4)
 	CALL_MCOUNT 0
 	lfd	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
index cfcff80bf7..7d974f925a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
@@ -32,7 +32,7 @@
    We set "round toward Zero" mode and trunc by adding +-2**23 then
    subtracting +-2**23.  */
 
-EALIGN (__truncf, 4, 0)
+ENTRY (__truncf, 4)
 	CALL_MCOUNT 0
 	lfs	fp13,.LC0@toc(2)
 	fabs	fp0,fp1
diff --git a/sysdeps/powerpc/powerpc64/lshift.S b/sysdeps/powerpc/powerpc64/lshift.S
index 480e38688b..e11b85d627 100644
--- a/sysdeps/powerpc/powerpc64/lshift.S
+++ b/sysdeps/powerpc/powerpc64/lshift.S
@@ -28,7 +28,7 @@
 #define U1      r31
 #define RETVAL   r5
 
-EALIGN(__mpn_lshift, 5, 0)
+ENTRY_TOCLESS (__mpn_lshift, 5)
 	std	U1, -8(r1)
 	std	U0, -16(r1)
 	subfic	TNC, CNT, 64
diff --git a/sysdeps/powerpc/powerpc64/memcpy.S b/sysdeps/powerpc/powerpc64/memcpy.S
index a4c82c31ef..b6a11055d8 100644
--- a/sysdeps/powerpc/powerpc64/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/memcpy.S
@@ -37,7 +37,7 @@
 # define MEMCPY memcpy
 #endif
 
-EALIGN (MEMCPY, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
 	CALL_MCOUNT 3
 
     cmpldi cr1,5,31
diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S
index f6581b50f7..34db4d7041 100644
--- a/sysdeps/powerpc/powerpc64/memset.S
+++ b/sysdeps/powerpc/powerpc64/memset.S
@@ -35,7 +35,7 @@
 # define MEMSET memset
 #endif
 
-EALIGN (MEMSET, 5, 0)
+ENTRY (MEMSET, 5)
 	CALL_MCOUNT 3
 
 #define rTMP	r0
diff --git a/sysdeps/powerpc/powerpc64/mul_1.S b/sysdeps/powerpc/powerpc64/mul_1.S
index 68e85cbdc8..f379180f87 100644
--- a/sysdeps/powerpc/powerpc64/mul_1.S
+++ b/sysdeps/powerpc/powerpc64/mul_1.S
@@ -24,7 +24,7 @@
 #define N   r5
 #define VL  r6
 
-EALIGN(__mpn_mul_1, 5, 0)
+ENTRY_TOCLESS (__mpn_mul_1, 5)
 	std	r27, -40(r1)
 	std	r26, -48(r1)
 	li	r12, 0
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
index a895dc6939..2b2b1de148 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
@@ -18,14 +18,17 @@
 
 #include <sysdep.h>
 
-#undef ENTRY
-#define ENTRY(name)						\
-  .section ".text";						\
-  ENTRY_2(__strrchr_power8);					\
-  .align ALIGNARG(2);						\
-  BODY_LABEL(__strrchr_power8):					\
-  cfi_startproc;						\
-  LOCALENTRY(__strrchr_power8)
+#undef ENTRY_TOCLESS
+#ifndef PROF
+#define ENTRY_TOCLESS(name, ...)				\
+	ENTRY_3 __strrchr_power8, ## __VA_ARGS__;		\
+	cfi_startproc
+#else
+#define ENTRY_TOCLESS(name, ...)				\
+	ENTRY_3 __strrchr_power8, ## __VA_ARGS__;		\
+	cfi_startproc;						\
+	LOCALENTRY(__strrchr_power8)
+#endif
 
 #undef END
 #define END(name)						\
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index 6ca98e909c..c366801d62 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -27,7 +27,7 @@
 #endif
 
 	.machine power4
-EALIGN (MEMCMP, 4, 0)
+ENTRY_TOCLESS (MEMCMP, 4)
 	CALL_MCOUNT 3
 
 #define rRTN	r3
diff --git a/sysdeps/powerpc/powerpc64/power4/memcpy.S b/sysdeps/powerpc/powerpc64/power4/memcpy.S
index 2e96376b9f..4bec39ce86 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcpy.S
@@ -37,7 +37,7 @@
 # define MEMCPY memcpy
 #endif
 	.machine power4
-EALIGN (MEMCPY, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
 	CALL_MCOUNT 3
 
     cmpldi cr1,5,31
diff --git a/sysdeps/powerpc/powerpc64/power4/memset.S b/sysdeps/powerpc/powerpc64/power4/memset.S
index a57214e0b0..0aafce785b 100644
--- a/sysdeps/powerpc/powerpc64/power4/memset.S
+++ b/sysdeps/powerpc/powerpc64/power4/memset.S
@@ -29,7 +29,7 @@
 # define MEMSET memset
 #endif
 	.machine power4
-EALIGN (MEMSET, 5, 0)
+ENTRY_TOCLESS (MEMSET, 5)
 	CALL_MCOUNT 3
 
 #define rTMP	r0
@@ -240,7 +240,7 @@ libc_hidden_builtin_def (memset)
 
 /* Copied from bzero.S to prevent the linker from inserting a stub
    between bzero and memset.  */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
 	CALL_MCOUNT 3
 	mr	r5,r4
 	li	r4,0
diff --git a/sysdeps/powerpc/powerpc64/power4/strncmp.S b/sysdeps/powerpc/powerpc64/power4/strncmp.S
index 2b0c00dfb2..2f978f64fb 100644
--- a/sysdeps/powerpc/powerpc64/power4/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/strncmp.S
@@ -26,7 +26,7 @@
 
 /* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5])  */
 
-EALIGN (STRNCMP, 4, 0)
+ENTRY_TOCLESS (STRNCMP, 4)
 	CALL_MCOUNT 3
 
 #define rTMP2	r0
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
index 39b7ee78e5..0d09e56e4e 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
@@ -20,7 +20,7 @@
 #include <math_ldbl_opt.h>
 
 	.machine	"power5"
-EALIGN (__ceil, 4, 0)
+ENTRY_TOCLESS (__ceil, 4)
 	CALL_MCOUNT 0
 	frip	fp1, fp1
 	blr
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
index d1c6f26d6d..364966088c 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
@@ -19,7 +19,7 @@
 #include <sysdep.h>
 
 	.machine	"power5"
-EALIGN (__ceilf, 4, 0)
+ENTRY_TOCLESS (__ceilf, 4)
 	CALL_MCOUNT 0
 	frip	fp1, fp1	/* The rounding instructions are double.  */
 	frsp	fp1, fp1	/* But we need to set ooverflow for float.  */
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
index 6411f15633..f8bfb2797e 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
@@ -20,7 +20,7 @@
 #include <math_ldbl_opt.h>
 
 	.machine	"power5"
-EALIGN (__floor, 4, 0)
+ENTRY_TOCLESS (__floor, 4)
 	CALL_MCOUNT 0
 	frim	fp1, fp1
 	blr
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
index 26c3b2594b..fa8a13d2a0 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
@@ -19,7 +19,7 @@
 #include <sysdep.h>
 
 	.machine	"power5"
-EALIGN (__floorf, 4, 0)
+ENTRY_TOCLESS (__floorf, 4)
 	CALL_MCOUNT 0
 	frim	fp1, fp1	/* The rounding instructions are double.  */
 	frsp	fp1, fp1	/* But we need to set ooverflow for float.  */
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
index 909714b449..4f9f850133 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
@@ -30,7 +30,7 @@
    round to zero instruction.  */
 
 	.machine	"power5"
-EALIGN (__llround, 4, 0)
+ENTRY_TOCLESS (__llround, 4)
 	CALL_MCOUNT 0
 	frin	fp2, fp1	/* Round to nearest +-0.5.  */
 	fctidz	fp3, fp2	/* Convert To Integer DW round toward 0.  */
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
index dc46d20f4f..0a124c80a6 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
@@ -20,7 +20,7 @@
 #include <math_ldbl_opt.h>
 
 	.machine	"power5"
-EALIGN (__round, 4, 0)
+ENTRY_TOCLESS (__round, 4)
 	CALL_MCOUNT 0
 	frin	fp1, fp1
 	blr
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
index 0a587843ad..39e28b4e46 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
@@ -19,7 +19,7 @@
 #include <sysdep.h>
 
 	.machine	"power5"
-EALIGN (__roundf, 4, 0)
+ENTRY_TOCLESS (__roundf, 4)
 	CALL_MCOUNT 0
 	frin	fp1, fp1	/* The rounding instructions are double.  */
 	frsp	fp1, fp1	/* But we need to set ooverflow for float.  */
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
index 7f8290e408..5fca9f37fa 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
@@ -20,7 +20,7 @@
 #include <math_ldbl_opt.h>
 
 	.machine	"power5"
-EALIGN (__trunc, 4, 0)
+ENTRY_TOCLESS (__trunc, 4)
 	CALL_MCOUNT 0
 	friz	fp1, fp1
 	blr
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
index 07f5d33127..ced4b61d2c 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
@@ -19,7 +19,7 @@
 #include <sysdep.h>
 
 	.machine	"power5"
-EALIGN (__truncf, 4, 0)
+ENTRY_TOCLESS (__truncf, 4)
 	CALL_MCOUNT 0
 	friz	fp1, fp1	/* The rounding instructions are double.  */
 	frsp	fp1, fp1	/* But we need to set ooverflow for float.  */
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
index d6a829ea37..a4725f762f 100644
--- a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
@@ -21,7 +21,7 @@
 
 /* int __isnan(x)  */
 	.machine power5
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
 	CALL_MCOUNT 0
 	stfd	fp1,-8(r1)	/* copy FPR to GPR */
 	lis	r0,0x7ff0
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
index ec36d1be5b..a64f1b8a0c 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
@@ -27,7 +27,7 @@
 	.section    ".text"
 	.type	    __copysign, @function
 	.machine    power6
-EALIGN (__copysign, 4, 0)
+ENTRY_TOCLESS (__copysign, 4)
 	CALL_MCOUNT 0
 	fcpsgn	fp1,fp2,fp1
 	blr
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
index 85187b45f3..c95e4aef3b 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
@@ -21,7 +21,7 @@
 
 /* int __isnan(x)  */
 	.machine power6
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
 	CALL_MCOUNT 0
 	stfd	fp1,-8(r1)	/* copy FPR to GPR */
 	ori	r1,r1,0
diff --git a/sysdeps/powerpc/powerpc64/power6/memcpy.S b/sysdeps/powerpc/powerpc64/power6/memcpy.S
index 1f7294b8ed..ac177ca4b7 100644
--- a/sysdeps/powerpc/powerpc64/power6/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/power6/memcpy.S
@@ -44,7 +44,7 @@
 # define MEMCPY memcpy
 #endif
 	.machine	"power6"
-EALIGN (MEMCPY, 7, 0)
+ENTRY_TOCLESS (MEMCPY, 7)
 	CALL_MCOUNT 3
 
     cmpldi cr1,5,31
diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S
index aee1c8eabb..8bbb8c4cb1 100644
--- a/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/sysdeps/powerpc/powerpc64/power6/memset.S
@@ -29,7 +29,7 @@
 # define MEMSET memset
 #endif
 	.machine power6
-EALIGN (MEMSET, 7, 0)
+ENTRY_TOCLESS (MEMSET, 7)
 	CALL_MCOUNT 3
 
 #define rTMP	r0
@@ -384,7 +384,7 @@ libc_hidden_builtin_def (memset)
 
 /* Copied from bzero.S to prevent the linker from inserting a stub
    between bzero and memset.  */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
 	CALL_MCOUNT 3
 	mr	r5,r4
 	li	r4,0
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
index b6e11ba0c3..d4b011d760 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
@@ -21,7 +21,7 @@
 
 /* int __isnan(x)  */
 	.machine power6
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
 	CALL_MCOUNT 0
 	mftgpr	r4,fp1		/* copy FPR to GPR */
 	lis	r0,0x7ff0
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
index 37aa69061c..f60d62f579 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
@@ -21,7 +21,7 @@
 
 	.machine	"power6"
 /* long long int[r3] __llrint (double x[fp1])  */
-ENTRY (__llrint)
+ENTRY_TOCLESS (__llrint)
 	CALL_MCOUNT 0
 	fctid	fp13,fp1
 	mftgpr  r3,fp13
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
index 62e1798785..6d1db55506 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
@@ -30,7 +30,7 @@
    round to zero instruction.  */
 
 	.machine	"power6"
-ENTRY (__llround)
+ENTRY_TOCLESS (__llround)
 	CALL_MCOUNT 0
 	frin	fp2,fp1	/* Round to nearest +-0.5.  */
 	fctidz	fp3,fp2	/* Convert To Integer DW round toward 0.  */
diff --git a/sysdeps/powerpc/powerpc64/power7/add_n.S b/sysdeps/powerpc/powerpc64/power7/add_n.S
index 6425afbc9f..02335c1848 100644
--- a/sysdeps/powerpc/powerpc64/power7/add_n.S
+++ b/sysdeps/powerpc/powerpc64/power7/add_n.S
@@ -36,7 +36,7 @@
 #define VP  r5
 #define N   r6
 
-EALIGN(FUNC, 5, 0)
+ENTRY_TOCLESS (FUNC, 5)
 #ifdef USE_AS_SUB
 	addic	r0, r0, 0
 #else
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
index 9ccc758c9e..1360289573 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
@@ -27,7 +27,7 @@
 	.section    ".text"
 	.type	    __finite, @function
 	.machine    power7
-EALIGN (__finite, 4, 0)
+ENTRY (__finite, 4)
 	CALL_MCOUNT 0
 	lfd     fp0,.LC0@toc(r2)
 	ftdiv   cr7,fp1,fp0
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
index 4482cddcfa..7c21c78e61 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
@@ -27,7 +27,7 @@
 	.section    ".text"
 	.type	    __isinf, @function
 	.machine    power7
-EALIGN (__isinf, 4, 0)
+ENTRY (__isinf, 4)
 	CALL_MCOUNT 0
 	lfd	fp0,.LC0@toc(r2)
 	ftdiv	cr7,fp1,fp0
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
index 46b08a0d37..8a925a2f8b 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
@@ -27,7 +27,7 @@
 	.section    ".text"
 	.type	    __isnan, @function
 	.machine    power7
-EALIGN (__isnan, 4, 0)
+ENTRY (__isnan, 4)
 	CALL_MCOUNT 0
 	lfd	fp0,.LC0@toc(r2)
 	ftdiv	cr7,fp1,fp0
diff --git a/sysdeps/powerpc/powerpc64/power7/memchr.S b/sysdeps/powerpc/powerpc64/power7/memchr.S
index 5e9707aa02..ec3ea62d33 100644
--- a/sysdeps/powerpc/powerpc64/power7/memchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/memchr.S
@@ -25,7 +25,7 @@
 # define MEMCHR __memchr
 #endif
 	.machine  power7
-ENTRY (MEMCHR)
+ENTRY_TOCLESS (MEMCHR)
 	CALL_MCOUNT 3
 	dcbt	0,r3
 	clrrdi  r8,r3,3
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 96ce8cee25..bee0424ba5 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -25,7 +25,7 @@
 # define MEMCMP memcmp
 #endif
 	.machine power7
-EALIGN (MEMCMP, 4, 0)
+ENTRY_TOCLESS (MEMCMP, 4)
 	CALL_MCOUNT 3
 
 #define rRTN		r3
diff --git a/sysdeps/powerpc/powerpc64/power7/memcpy.S b/sysdeps/powerpc/powerpc64/power7/memcpy.S
index e08993cbc3..641c7e2118 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcpy.S
@@ -32,7 +32,7 @@
 #define cnt 5
 
 	.machine power7
-EALIGN (MEMCPY, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
 	CALL_MCOUNT 3
 
 	cmpldi	cr1,cnt,31
diff --git a/sysdeps/powerpc/powerpc64/power7/memmove.S b/sysdeps/powerpc/powerpc64/power7/memmove.S
index 4c0f7c3571..93baa69ee2 100644
--- a/sysdeps/powerpc/powerpc64/power7/memmove.S
+++ b/sysdeps/powerpc/powerpc64/power7/memmove.S
@@ -31,7 +31,7 @@
 # define MEMMOVE memmove
 #endif
 	.machine power7
-EALIGN (MEMMOVE, 5, 0)
+ENTRY_TOCLESS (MEMMOVE, 5)
 	CALL_MCOUNT 3
 
 L(_memmove):
@@ -826,7 +826,7 @@ libc_hidden_builtin_def (memmove)
 /* void bcopy(const void *src [r3], void *dest [r4], size_t n [r5])
    Implemented in this file to avoid linker create a stub function call
    in the branch to '_memmove'.  */
-ENTRY (__bcopy)
+ENTRY_TOCLESS (__bcopy)
 	mr	r6,r3
 	mr	r3,r4
 	mr	r4,r6
diff --git a/sysdeps/powerpc/powerpc64/power7/mempcpy.S b/sysdeps/powerpc/powerpc64/power7/mempcpy.S
index 4e15d1e40c..904fac5d1c 100644
--- a/sysdeps/powerpc/powerpc64/power7/mempcpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/mempcpy.S
@@ -27,7 +27,7 @@
 # define MEMPCPY __mempcpy
 #endif
 	.machine  power7
-EALIGN (MEMPCPY, 5, 0)
+ENTRY_TOCLESS (MEMPCPY, 5)
 	CALL_MCOUNT 3
 
 	cmpldi	cr1,5,31
diff --git a/sysdeps/powerpc/powerpc64/power7/memrchr.S b/sysdeps/powerpc/powerpc64/power7/memrchr.S
index 4276768915..92b9d1976d 100644
--- a/sysdeps/powerpc/powerpc64/power7/memrchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/memrchr.S
@@ -25,7 +25,7 @@
 # define MEMRCHR __memrchr
 #endif
 	.machine  power7
-ENTRY (MEMRCHR)
+ENTRY_TOCLESS (MEMRCHR)
 	CALL_MCOUNT 3
 	add	r7,r3,r5      /* Calculate the last acceptable address.  */
 	neg	r0,r7
diff --git a/sysdeps/powerpc/powerpc64/power7/memset.S b/sysdeps/powerpc/powerpc64/power7/memset.S
index 21933c0672..f2e2fa1b37 100644
--- a/sysdeps/powerpc/powerpc64/power7/memset.S
+++ b/sysdeps/powerpc/powerpc64/power7/memset.S
@@ -26,7 +26,7 @@
 # define MEMSET memset
 #endif
 	.machine power7
-EALIGN (MEMSET, 5, 0)
+ENTRY_TOCLESS (MEMSET, 5)
 	CALL_MCOUNT 3
 
 L(_memset):
@@ -388,7 +388,7 @@ libc_hidden_builtin_def (memset)
 
 /* Copied from bzero.S to prevent the linker from inserting a stub
    between bzero and memset.  */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
 	CALL_MCOUNT 3
 	mr	r5,r4
 	li	r4,0
diff --git a/sysdeps/powerpc/powerpc64/power7/rawmemchr.S b/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
index 48afb75943..86ea4a68bc 100644
--- a/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
@@ -25,7 +25,7 @@
 # define RAWMEMCHR __rawmemchr
 #endif
 	.machine  power7
-ENTRY (RAWMEMCHR)
+ENTRY_TOCLESS (RAWMEMCHR)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S b/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
index e856b8a593..224318720e 100644
--- a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
@@ -31,10 +31,11 @@
 # define STRCMP   strcasecmp
 #endif
 
-ENTRY (__STRCMP)
 #ifndef USE_IN_EXTENDED_LOCALE_MODEL
+ENTRY (__STRCMP)
 	CALL_MCOUNT 2
 #else
+ENTRY_TOCLESS (__STRCMP)
 	CALL_MCOUNT 3
 #endif
 
diff --git a/sysdeps/powerpc/powerpc64/power7/strchr.S b/sysdeps/powerpc/powerpc64/power7/strchr.S
index a18e2e101c..1d53dbe3b5 100644
--- a/sysdeps/powerpc/powerpc64/power7/strchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strchr.S
@@ -25,7 +25,7 @@
 
 /* int [r3] strchr (char *s [r3], int c [r4])  */
 	.machine  power7
-ENTRY (STRCHR)
+ENTRY_TOCLESS (STRCHR)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power7/strchrnul.S b/sysdeps/powerpc/powerpc64/power7/strchrnul.S
index 27bc1f0682..eb69953376 100644
--- a/sysdeps/powerpc/powerpc64/power7/strchrnul.S
+++ b/sysdeps/powerpc/powerpc64/power7/strchrnul.S
@@ -24,7 +24,7 @@
 #endif
 /* int [r3] strchrnul (char *s [r3], int c [r4])  */
 	.machine  power7
-ENTRY (STRCHRNUL)
+ENTRY_TOCLESS (STRCHRNUL)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power7/strcmp.S b/sysdeps/powerpc/powerpc64/power7/strcmp.S
index 14e14f457e..69b1ff9b0a 100644
--- a/sysdeps/powerpc/powerpc64/power7/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strcmp.S
@@ -30,7 +30,7 @@
 /* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4])  */
 
 	.machine	power7
-EALIGN (STRCMP, 4, 0)
+ENTRY_TOCLESS (STRCMP, 4)
 	CALL_MCOUNT 2
 
 	or r9, r3, r4
diff --git a/sysdeps/powerpc/powerpc64/power7/strlen.S b/sysdeps/powerpc/powerpc64/power7/strlen.S
index 63848c460c..317dad5fa9 100644
--- a/sysdeps/powerpc/powerpc64/power7/strlen.S
+++ b/sysdeps/powerpc/powerpc64/power7/strlen.S
@@ -25,7 +25,7 @@
 # define STRLEN strlen
 #endif
 	.machine  power7
-ENTRY (STRLEN)
+ENTRY_TOCLESS (STRLEN)
 	CALL_MCOUNT 1
 	dcbt	0,r3
 	clrrdi	r4,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power7/strncmp.S b/sysdeps/powerpc/powerpc64/power7/strncmp.S
index d53b31be8e..ffe7e8e687 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strncmp.S
@@ -28,7 +28,7 @@
 		     const char *s2 [r4],
 		     size_t size [r5])  */
 
-EALIGN (STRNCMP,5,0)
+ENTRY_TOCLESS (STRNCMP, 5)
 	CALL_MCOUNT 3
 
 #define rTMP2	r0
diff --git a/sysdeps/powerpc/powerpc64/power7/strncpy.S b/sysdeps/powerpc/powerpc64/power7/strncpy.S
index 88d797908c..b2833b8a50 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/strncpy.S
@@ -67,7 +67,11 @@
 #endif
 
 	.machine  power7
-EALIGN(FUNC_NAME, 4, 0)
+#ifdef MEMSET_is_local
+ENTRY_TOCLESS (FUNC_NAME, 4)
+#else
+ENTRY (FUNC_NAME, 4)
+#endif
 	CALL_MCOUNT 3
 
 	mflr r0			/* load link register LR to r0  */
diff --git a/sysdeps/powerpc/powerpc64/power7/strnlen.S b/sysdeps/powerpc/powerpc64/power7/strnlen.S
index a970b6ce30..0ee659fd37 100644
--- a/sysdeps/powerpc/powerpc64/power7/strnlen.S
+++ b/sysdeps/powerpc/powerpc64/power7/strnlen.S
@@ -25,7 +25,7 @@
 
 /* int [r3] strnlen (char *s [r3], int size [r4])  */
 	.machine  power7
-ENTRY (STRNLEN)
+ENTRY_TOCLESS (STRNLEN)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3
diff --git a/sysdeps/powerpc/powerpc64/power7/strrchr.S b/sysdeps/powerpc/powerpc64/power7/strrchr.S
index c22393deb5..98310e4c23 100644
--- a/sysdeps/powerpc/powerpc64/power7/strrchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strrchr.S
@@ -25,7 +25,7 @@
 #endif
 
 	.machine  power7
-ENTRY (STRRCHR)
+ENTRY_TOCLESS (STRRCHR)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power7/strstr.S b/sysdeps/powerpc/powerpc64/power7/strstr.S
index 1c432534a3..c2d727d8b4 100644
--- a/sysdeps/powerpc/powerpc64/power7/strstr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strstr.S
@@ -62,7 +62,8 @@
 
 #define	FRAMESIZE	(FRAME_MIN_SIZE+32)
 	.machine  power7
-EALIGN (STRSTR, 4, 0)
+/* Can't be ENTRY_TOCLESS due to calling __strstr_ppc which uses r2.  */
+ENTRY (STRSTR, 4)
 	CALL_MCOUNT 2
 	mflr	r0			/* Load link register LR to r0.  */
 	std	r31, -8(r1)		/* Save callers register r31.  */
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S b/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S
index 4c42926a74..d9433d88e4 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S
@@ -55,7 +55,7 @@
    float [fp1] expf (float [fp1] x)  */
 
 	.machine power8
-EALIGN(__ieee754_expf, 4, 0)
+ENTRY (__ieee754_expf, 4)
 	addis	DATA_OFFSET,r2,.Lanchor@toc@ha
 	addi	DATA_OFFSET,DATA_OFFSET,.Lanchor@toc@l
 
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S
index 8dfa0076e0..d45496d3b3 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S
@@ -39,7 +39,7 @@
 	   float [fp1] cosf (float [fp1] x)  */
 
 	.machine power8
-EALIGN(__cosf, 4, 0)
+ENTRY (__cosf, 4)
 	addis	r9,r2,L(anchor)@toc@ha
 	addi	r9,r9,L(anchor)@toc@l
 
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
index fcdcb60293..80181b74f7 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
@@ -23,7 +23,7 @@
 
 /* int [r3] __finite ([fp1] x)  */
 
-EALIGN (__finite, 4, 0)
+ENTRY_TOCLESS (__finite, 4)
 	CALL_MCOUNT 0
 	MFVSRD_R3_V1
 	lis     r9,0x8010
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
index 32814e4525..01f57a8dbf 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
@@ -23,7 +23,7 @@
 
 /* int [r3] __isinf([fp1] x)  */
 
-EALIGN (__isinf, 4, 0)
+ENTRY_TOCLESS (__isinf, 4)
 	CALL_MCOUNT 0
 	MFVSRD_R3_V1
 	lis     r9,0x7ff0     /* r9 = 0x7ff0  */
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
index af52e502b7..87be552fe6 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
@@ -23,7 +23,7 @@
 
 /* int [r3] __isnan([f1] x)  */
 
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
 	CALL_MCOUNT 0
 	MFVSRD_R3_V1
 	lis     r9,0x7ff0
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
index aa180b6901..6980abcc4f 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
@@ -22,7 +22,7 @@
 #define MFVSRD_R3_V1  .long 0x7c230066     /* mfvsrd  r3,vs1  */
 
 /* long long int[r3] __llrint (double x[fp1])  */
-ENTRY (__llrint)
+ENTRY_TOCLESS (__llrint)
 	CALL_MCOUNT 0
 	fctid	fp1,fp1
 	MFVSRD_R3_V1
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
index 043fc6a089..8bdc162752 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
@@ -24,7 +24,7 @@
 
 /* long long [r3] llround (float x [fp1])  */
 
-ENTRY (__llround)
+ENTRY_TOCLESS (__llround)
 	CALL_MCOUNT 0
 	frin	fp1,fp1	/* Round to nearest +-0.5.  */
 	fctidz	fp1,fp1	/* Convert To Integer DW round toward 0.  */
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S
index fb0add3462..d5335d8d57 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S
@@ -39,7 +39,7 @@
 	   float [fp1] sinf (float [fp1] x)  */
 
 	.machine power8
-EALIGN(__sinf, 4, 0)
+ENTRY (__sinf, 4)
 	addis	r9,r2,L(anchor)@toc@ha
 	addi	r9,r9,L(anchor)@toc@l
 
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 46b9c0067a..ba8cd13831 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -29,7 +29,7 @@
 # define MEMCMP memcmp
 #endif
 	.machine power7
-EALIGN (MEMCMP, 4, 0)
+ENTRY_TOCLESS (MEMCMP, 4)
 	CALL_MCOUNT 3
 
 #define rRTN		r3
diff --git a/sysdeps/powerpc/powerpc64/power8/memset.S b/sysdeps/powerpc/powerpc64/power8/memset.S
index bc734c9f4f..7ad3bb1b00 100644
--- a/sysdeps/powerpc/powerpc64/power8/memset.S
+++ b/sysdeps/powerpc/powerpc64/power8/memset.S
@@ -31,7 +31,7 @@
 	   handled by the define.  It avoid breakage on binutils
 	   that does not support this machine specifier.  */
 	.machine power7
-EALIGN (MEMSET, 5, 0)
+ENTRY_TOCLESS (MEMSET, 5)
 	CALL_MCOUNT 3
 
 L(_memset):
@@ -447,7 +447,7 @@ libc_hidden_builtin_def (memset)
 
 /* Copied from bzero.S to prevent the linker from inserting a stub
    between bzero and memset.  */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
 	CALL_MCOUNT 3
 	mr	r5,r4
 	li	r4,0
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr.S b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
index 6ac6572f3b..3f59cb0f68 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcasestr.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
@@ -85,7 +85,7 @@
 /* TODO: change this to .machine power8 when the minimum required binutils
    allows it.  */
 	.machine  power7
-EALIGN (STRCASESTR, 4, 0)
+ENTRY (STRCASESTR, 4)
 	CALL_MCOUNT 2
 	mflr	r0			/* Load link register LR to r0.  */
 	std	r31, -8(r1)		/* Save callers register r31.  */
diff --git a/sysdeps/powerpc/powerpc64/power8/strchr.S b/sysdeps/powerpc/powerpc64/power8/strchr.S
index e0c185c162..63f75330e0 100644
--- a/sysdeps/powerpc/powerpc64/power8/strchr.S
+++ b/sysdeps/powerpc/powerpc64/power8/strchr.S
@@ -44,7 +44,7 @@
 /* TODO: change this to .machine power8 when the minimum required binutils
    allows it.  */
 	.machine  power7
-ENTRY (FUNC_NAME)
+ENTRY_TOCLESS (FUNC_NAME)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power8/strcmp.S b/sysdeps/powerpc/powerpc64/power8/strcmp.S
index 770484f1e1..ff19f7f64a 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcmp.S
@@ -31,7 +31,7 @@
    64K as default, the page cross handling assumes minimum page size of
    4k.  */
 
-EALIGN (STRCMP, 4, 0)
+ENTRY_TOCLESS (STRCMP, 4)
 	li	r0,0
 
 	/* Check if [s1]+16 or [s2]+16 will cross a 4K page boundary using
diff --git a/sysdeps/powerpc/powerpc64/power8/strcpy.S b/sysdeps/powerpc/powerpc64/power8/strcpy.S
index 7f2cee4b1b..13e7a0fcbc 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcpy.S
@@ -48,7 +48,7 @@
    4k.  */
 
 	.machine  power7
-EALIGN (FUNC_NAME, 4, 0)
+ENTRY_TOCLESS (FUNC_NAME, 4)
         li      r0,0          /* Doubleword with null chars to use
                                  with cmpb.  */
 
diff --git a/sysdeps/powerpc/powerpc64/power8/strlen.S b/sysdeps/powerpc/powerpc64/power8/strlen.S
index 8f4a1fc1dc..8fdb6f5cc1 100644
--- a/sysdeps/powerpc/powerpc64/power8/strlen.S
+++ b/sysdeps/powerpc/powerpc64/power8/strlen.S
@@ -36,7 +36,7 @@
 /* TODO: change this to .machine power8 when the minimum required binutils
    allows it.  */
 	.machine  power7
-EALIGN (STRLEN, 4, 0)
+ENTRY_TOCLESS (STRLEN, 4)
 	CALL_MCOUNT 1
 	dcbt	0,r3
 	clrrdi	r4,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power8/strncmp.S b/sysdeps/powerpc/powerpc64/power8/strncmp.S
index 3d8df90538..84bfcb1f1c 100644
--- a/sysdeps/powerpc/powerpc64/power8/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strncmp.S
@@ -32,7 +32,7 @@
    4k.  */
 
 	.machine  power7
-EALIGN (STRNCMP, 4, 0)
+ENTRY_TOCLESS (STRNCMP, 4)
 	/* Check if size is 0.  */
 	mr.	r10,r5
 	beq	cr0,L(ret0)
diff --git a/sysdeps/powerpc/powerpc64/power8/strncpy.S b/sysdeps/powerpc/powerpc64/power8/strncpy.S
index 552c5cc577..150290ae4a 100644
--- a/sysdeps/powerpc/powerpc64/power8/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/strncpy.S
@@ -61,7 +61,11 @@
    4k.  */
 
 	.machine  power7
-EALIGN (FUNC_NAME, 4, 0)
+#ifdef MEMSET_is_local
+ENTRY_TOCLESS (FUNC_NAME, 4)
+#else
+ENTRY (FUNC_NAME, 4)
+#endif
 	CALL_MCOUNT 3
 
         /* Check if the [src]+15 will cross a 4K page by checking if the bit
diff --git a/sysdeps/powerpc/powerpc64/power8/strnlen.S b/sysdeps/powerpc/powerpc64/power8/strnlen.S
index 3eadbfb09e..07608ffa26 100644
--- a/sysdeps/powerpc/powerpc64/power8/strnlen.S
+++ b/sysdeps/powerpc/powerpc64/power8/strnlen.S
@@ -59,7 +59,7 @@
 /* int [r3] strnlen (char *s [r3], size_t maxlen [r4])  */
 /* TODO: change to power8 when minimum required binutils allows it.  */
 	.machine  power7
-ENTRY (__strnlen)
+ENTRY_TOCLESS (__strnlen)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 
diff --git a/sysdeps/powerpc/powerpc64/power8/strrchr.S b/sysdeps/powerpc/powerpc64/power8/strrchr.S
index 8eb74853c3..0ba61389a7 100644
--- a/sysdeps/powerpc/powerpc64/power8/strrchr.S
+++ b/sysdeps/powerpc/powerpc64/power8/strrchr.S
@@ -77,7 +77,7 @@
 	vsumsws	v2, v2, v0;
 #endif	/* !__LITTLE_ENDIAN__  */
 	.machine  power7
-ENTRY (strrchr)
+ENTRY_TOCLESS (strrchr)
 	CALL_MCOUNT 2
 	dcbt	0,r3
 	clrrdi	r8,r3,3	      /* Align the address to doubleword boundary.  */
diff --git a/sysdeps/powerpc/powerpc64/power8/strspn.S b/sysdeps/powerpc/powerpc64/power8/strspn.S
index e9271898f2..dcd1df425c 100644
--- a/sysdeps/powerpc/powerpc64/power8/strspn.S
+++ b/sysdeps/powerpc/powerpc64/power8/strspn.S
@@ -68,7 +68,7 @@
 	/* This can be updated to power8 once the minimum version of
 	   binutils supports power8 and the above instructions.  */
 	.machine power7
-EALIGN(STRSPN, 4, 0)
+ENTRY_TOCLESS (STRSPN, 4)
 	CALL_MCOUNT 2
 
 	/* Generate useful constants for later on.  */
diff --git a/sysdeps/powerpc/powerpc64/power9/strcmp.S b/sysdeps/powerpc/powerpc64/power9/strcmp.S
index 2dc4f6c722..87883ef0c8 100644
--- a/sysdeps/powerpc/powerpc64/power9/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/power9/strcmp.S
@@ -66,7 +66,7 @@
    allows it.  */
 
 	.machine  power7
-EALIGN (STRCMP, 4, 0)
+ENTRY_TOCLESS (STRCMP, 4)
 	li	r0, 0
 
 	/* Check if [s1]+16 or [s2]+16 will cross a 4K page boundary using
diff --git a/sysdeps/powerpc/powerpc64/power9/strncmp.S b/sysdeps/powerpc/powerpc64/power9/strncmp.S
index c946a5c638..ff6f8aceeb 100644
--- a/sysdeps/powerpc/powerpc64/power9/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power9/strncmp.S
@@ -68,7 +68,7 @@
 /* TODO: change this to .machine power9 when minimum binutils
    is upgraded to 2.27.  */
 	.machine  power7
-EALIGN (STRNCMP, 4, 0)
+ENTRY_TOCLESS (STRNCMP, 4)
 	/* Check if size is 0.  */
 	cmpdi	cr0, r5, 0
 	beq	cr0, L(ret0)
diff --git a/sysdeps/powerpc/powerpc64/ppc-mcount.S b/sysdeps/powerpc/powerpc64/ppc-mcount.S
index 8312f46644..693621104a 100644
--- a/sysdeps/powerpc/powerpc64/ppc-mcount.S
+++ b/sysdeps/powerpc/powerpc64/ppc-mcount.S
@@ -24,13 +24,15 @@
 ENTRY(_mcount)
 	mflr		 r4
 	ld		 r11, 0(r1)
+	std		 r4, FRAME_LR_SAVE(r1)
 	stdu		 r1,-FRAME_MIN_SIZE(r1)
 	cfi_adjust_cfa_offset (FRAME_MIN_SIZE)
-	std		 r4, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
 	cfi_offset (lr, FRAME_LR_SAVE)
 	ld		 r3, FRAME_LR_SAVE(r11)
 	bl		 JUMPTARGET(__mcount_internal)
+#ifndef SHARED
 	nop
+#endif
 	ld		 r0, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
 	mtlr		 r0
 	addi		 r1,r1,FRAME_MIN_SIZE
diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
index 937c39a740..05ed67e5b8 100644
--- a/sysdeps/powerpc/powerpc64/start.S
+++ b/sysdeps/powerpc/powerpc64/start.S
@@ -62,7 +62,7 @@ L(start_addresses):
 .L01:
 	.tc	L(start_addresses)[TC],L(start_addresses)
 	.section ".text"
-ENTRY(_start)
+ENTRY (_start)
  /* Save the stack pointer, in case we're statically linked under Linux.  */
 	mr	r9,r1
  /* Set up an initial stack frame, and clear the LR.  */
@@ -78,7 +78,7 @@ ENTRY(_start)
 
  /* and continue in libc-start, in glibc.  */
 	b	JUMPTARGET(__libc_start_main)
-/* The linker needs this nop to recognize that it's OK to call via a
+/* Older versions of ld need this nop to recognize that it's OK to call via a
    TOC adjusting stub.  */
 	nop
 
diff --git a/sysdeps/powerpc/powerpc64/strchr.S b/sysdeps/powerpc/powerpc64/strchr.S
index cbfcc14cfe..c0ddb00bbd 100644
--- a/sysdeps/powerpc/powerpc64/strchr.S
+++ b/sysdeps/powerpc/powerpc64/strchr.S
@@ -26,7 +26,7 @@
 # define STRCHR strchr
 #endif
 
-ENTRY (STRCHR)
+ENTRY_TOCLESS (STRCHR)
 	CALL_MCOUNT 2
 
 #define rTMP1	r0
diff --git a/sysdeps/powerpc/powerpc64/strcmp.S b/sysdeps/powerpc/powerpc64/strcmp.S
index ab5f8c231c..69b953fc7b 100644
--- a/sysdeps/powerpc/powerpc64/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/strcmp.S
@@ -26,7 +26,7 @@
 # define STRCMP strcmp
 #endif
 
-EALIGN (STRCMP, 4, 0)
+ENTRY_TOCLESS (STRCMP, 4)
 	CALL_MCOUNT 2
 
 #define rTMP2	r0
diff --git a/sysdeps/powerpc/powerpc64/strlen.S b/sysdeps/powerpc/powerpc64/strlen.S
index 1466624c6a..0d8a38b0cd 100644
--- a/sysdeps/powerpc/powerpc64/strlen.S
+++ b/sysdeps/powerpc/powerpc64/strlen.S
@@ -84,7 +84,7 @@
 # define STRLEN strlen
 #endif
 
-ENTRY (STRLEN)
+ENTRY_TOCLESS (STRLEN)
 	CALL_MCOUNT 1
 
 #define rTMP4	r0
diff --git a/sysdeps/powerpc/powerpc64/strncmp.S b/sysdeps/powerpc/powerpc64/strncmp.S
index 076599804a..c314293e81 100644
--- a/sysdeps/powerpc/powerpc64/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/strncmp.S
@@ -26,7 +26,7 @@
 # define STRNCMP strncmp
 #endif
 
-EALIGN (STRNCMP, 4, 0)
+ENTRY_TOCLESS (STRNCMP, 4)
 	CALL_MCOUNT 3
 
 #define rTMP2	r0
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index 860420ea2d..ab5f395cfd 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -146,34 +146,51 @@
 
 #endif /* _CALL_ELF */
 
-#define ENTRY(name)	\
-	.section	".text";		\
-	ENTRY_2(name);				\
-	.align ALIGNARG(2);			\
-BODY_LABEL(name):				\
-	cfi_startproc;				\
-	LOCALENTRY(name)
+	.macro NOPS NARG
+	.if \NARG
+	NOPS \NARG-1
+	nop
+	.endif
+	.endm
 
-#define EALIGN_W_0  /* No words to insert.  */
-#define EALIGN_W_1  nop
-#define EALIGN_W_2  nop;nop
-#define EALIGN_W_3  nop;nop;nop
-#define EALIGN_W_4  EALIGN_W_3;nop
-#define EALIGN_W_5  EALIGN_W_4;nop
-#define EALIGN_W_6  EALIGN_W_5;nop
-#define EALIGN_W_7  EALIGN_W_6;nop
-
-/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
-   past a 2^alignt boundary.  */
-#define EALIGN(name, alignt, words) \
-	.section	".text";		\
-	ENTRY_2(name);				\
-	.align ALIGNARG(alignt);		\
-	EALIGN_W_##words;			\
-BODY_LABEL(name):				\
+	.macro ENTRY_3 name, alignp2=2, nopwords=0
+	.text
+	ENTRY_2(\name)
+	.p2align \alignp2
+	NOPS \nopwords
+BODY_LABEL(\name):
+	.endm
+
+/* Use ENTRY_TOCLESS for functions that make no use of r2 and
+   guarantee r2 is unchanged on exit.  Any function that has @toc or
+   @got relocs uses r2.  Functions that call other functions via the
+   PLT use r2.  Use ENTRY for functions that may use or change r2.
+   The first argument is the function name.
+   The optional second argument specifies alignment of the function's
+   code, as the logarithm base two of the byte alignment.  For
+   example, a value of four aligns to a sixteen byte boundary.
+   The optional third argument specifies the number of NOPs to emit
+   before the start of the function's code.   */
+#ifndef PROF
+#define ENTRY_TOCLESS(name, ...)		\
+	ENTRY_3 name, ## __VA_ARGS__;		\
+	cfi_startproc
+
+#define ENTRY(name, ...)			\
+	ENTRY_TOCLESS(name, ## __VA_ARGS__);	\
+	LOCALENTRY(name)
+#else
+/* The call to _mcount is potentially via the plt, so profiling code
+   is never free of an r2 use.  */
+#define ENTRY_TOCLESS(name, ...)		\
+	ENTRY_3 name, ## __VA_ARGS__;		\
 	cfi_startproc;				\
 	LOCALENTRY(name)
 
+#define ENTRY(name, ...)			\
+	ENTRY_TOCLESS(name, ## __VA_ARGS__)
+#endif
+
 /* Local labels stripped out by the linker.  */
 #undef L
 #define L(x) .L##x