about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-04-11 00:02:52 +0000
committerUlrich Drepper <drepper@redhat.com>2008-04-11 00:02:52 +0000
commit153cf97250c5d8fe8e9a7b43db1673cc9acfc4e3 (patch)
tree3c70edbdf610c1dd8bd17aa9732e9e29e0effb40
parentd1235fdf097cfdfe48cbcc630553ba28d53f96a2 (diff)
downloadglibc-153cf97250c5d8fe8e9a7b43db1673cc9acfc4e3.tar.gz
glibc-153cf97250c5d8fe8e9a7b43db1673cc9acfc4e3.tar.xz
glibc-153cf97250c5d8fe8e9a7b43db1673cc9acfc4e3.zip
[BZ #5741]
2008-01-24  Steven Munroe  <sjmunroe@us.ibm.com>
	[BZ #5741]
	* sysdeps/powerpc/powerpc64/dl-machine.h (PPC_DCBT, PPC_DCBF):
	Define additonal Data Cache Block instruction macros.
	(elf_machine_fixup_plt): Add dcbt for opd and plt entries.
	Replace dcbst with dcbf and sync with sync/isync.
-rw-r--r--ChangeLog8
-rw-r--r--sysdeps/powerpc/powerpc64/dl-machine.h16
2 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c975017272..37af8e0f1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-24  Steven Munroe  <sjmunroe@us.ibm.com>
+
+	[BZ #5741]
+	* sysdeps/powerpc/powerpc64/dl-machine.h (PPC_DCBT, PPC_DCBF):
+	Define additonal Data Cache Block instruction macros.
+	(elf_machine_fixup_plt): Add dcbt for opd and plt entries.
+	Replace dcbst with dcbf and sync with sync/isync.
+
 2008-02-21  Alan Modra  <amodra@bigpond.net.au>
 
 	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_type_class):
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h
index c837393d79..b674dbef43 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.h
+++ b/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -1,6 +1,6 @@
 /* Machine-dependent ELF dynamic relocation inline functions.
    PowerPC64 version.
-   Copyright 1995-2005, 2006 Free Software Foundation, Inc.
+   Copyright 1995-2005, 2006, 2008 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
@@ -287,6 +287,8 @@ BODY_PREFIX "_dl_start_user:\n"						\
 #define GLINK_INITIAL_ENTRY_WORDS 8
 
 #define PPC_DCBST(where) asm volatile ("dcbst 0,%0" : : "r"(where) : "memory")
+#define PPC_DCBT(where) asm volatile ("dcbt 0,%0" : : "r"(where) : "memory")
+#define PPC_DCBF(where) asm volatile ("dcbf 0,%0" : : "r"(where) : "memory")
 #define PPC_SYNC asm volatile ("sync" : : : "memory")
 #define PPC_ISYNC asm volatile ("sync; isync" : : : "memory")
 #define PPC_ICBI(where) asm volatile ("icbi 0,%0" : : "r"(where) : "memory")
@@ -408,6 +410,11 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
   Elf64_FuncDesc *rel = (Elf64_FuncDesc *) finaladdr;
   Elf64_Addr offset = 0;
 
+  PPC_DCBT (&plt->fd_aux);
+  PPC_DCBT (&plt->fd_func);
+  PPC_DCBT (&rel->fd_aux);
+  PPC_DCBT (&rel->fd_func);
+
   /* If sym_map is NULL, it's a weak undefined sym;  Leave the plt zero.  */
   if (sym_map == NULL)
     return 0;
@@ -430,13 +437,12 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
 
   plt->fd_aux = rel->fd_aux + offset;
   plt->fd_toc = rel->fd_toc + offset;
-  PPC_DCBST (&plt->fd_aux);
-  PPC_DCBST (&plt->fd_toc);
-  PPC_SYNC;
+  PPC_DCBF (&plt->fd_toc);
+  PPC_ISYNC;
 
   plt->fd_func = rel->fd_func + offset;
   PPC_DCBST (&plt->fd_func);
-  PPC_SYNC;
+  PPC_ISYNC;
 
   return finaladdr;
 }