about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/memset.S
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-01-10 19:14:56 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-01-17 09:05:03 -0300
commit18363b4f010da9ba459b13310b113ac0647c2fcc (patch)
treea9b4b22d7fb65d7d219eb0e10b996de971da54e9 /sysdeps/powerpc/powerpc64/memset.S
parentc908ae0492cb9c68736306e2bceec7244a940568 (diff)
downloadglibc-18363b4f010da9ba459b13310b113ac0647c2fcc.tar.gz
glibc-18363b4f010da9ba459b13310b113ac0647c2fcc.tar.xz
glibc-18363b4f010da9ba459b13310b113ac0647c2fcc.zip
powerpc: Move cache line size to rtld_global_ro
GCC 10.0 enabled -fno-common by default and this started to point that
__cache_line_size had been implemented in 2 different places: loader and
libc.

In order to avoid this duplication, the libc variable has been removed
and the loader variable is moved to rtld_global_ro.

File sysdeps/unix/sysv/linux/powerpc/dl-auxv.h has been added in order
to reuse code for both static and dynamic linking scenarios.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/powerpc/powerpc64/memset.S')
-rw-r--r--sysdeps/powerpc/powerpc64/memset.S11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S
index 857c023755..2fa98e6e2d 100644
--- a/sysdeps/powerpc/powerpc64/memset.S
+++ b/sysdeps/powerpc/powerpc64/memset.S
@@ -17,10 +17,11 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <rtld-global-offsets.h>
 
 	.section	".toc","aw"
-.LC0:
-	.tc __cache_line_size[TC],__cache_line_size
+__GLRO_DEF(dl_cache_line_size)
+
 	.section	".text"
 	.align 2
 
@@ -146,8 +147,10 @@ L(zloopstart):
 /* If the remaining length is less the 32 bytes, don't bother getting
 	 the cache line size.  */
 	beq	L(medium)
-	ld	rCLS,.LC0@toc(r2)
-	lwz	rCLS,0(rCLS)
+	/* Read the cache line size.  */
+	__GLRO (rCLS, dl_cache_line_size,
+		RTLD_GLOBAL_RO_DL_CACHE_LINE_SIZE_OFFSET)
+
 /* If the cache line size was not set just goto to L(nondcbz) which is
 	 safe for any cache line size.  */
 	cmpldi	cr1,rCLS,0