summaryrefslogtreecommitdiff
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-10-14 13:56:26 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-10-14 13:56:26 +0000
commit50e2c9a009a8a23a4b87e587986f81f4109fce16 (patch)
tree7ac77a979e2b4e7cf7f8667c9efe0dfb802a6328 /libexec/rtld-elf
parentbda47a9059e579e34ad3ef16e44398b4f68b77dc (diff)
Notes
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/powerpc/reloc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c
index ccdcd90de244..eca57550f764 100644
--- a/libexec/rtld-elf/powerpc/reloc.c
+++ b/libexec/rtld-elf/powerpc/reloc.c
@@ -38,6 +38,7 @@
#include <string.h>
#include <unistd.h>
#include <machine/cpu.h>
+#include <machine/cpufunc.h>
#include <machine/md_var.h>
#include "debug.h"
@@ -485,6 +486,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
jmptab = obj->pltgot + JMPTAB_BASE(N);
jmptab[reloff] = target;
+ powerpc_mb(); /* Order jmptab update before next changes */
if (reloff < PLT_EXTENDED_BEGIN) {
/* for extended PLT entries, we keep the old code */
@@ -493,7 +495,8 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
/* li r11,reloff */
/* b pltcall # use indirect pltcall routine */
- wherep[0] = 0x39600000 | reloff;
+
+ /* first instruction same as before */
wherep[1] = 0x48000000 | (distance & 0x03fffffc);
__syncicache(wherep, 8);
}
@@ -581,7 +584,7 @@ init_pltgot(Obj_Entry *obj)
* Sync the icache for the byte range represented by the
* trampoline routines and call slots.
*/
- __syncicache(pltcall, 72 + N * 8);
+ __syncicache(obj->pltgot, JMPTAB_BASE(N)*4);
}
void