summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2001-11-26 03:27:43 +0000
committerDavid Schleef <ds@schleef.org>2001-11-26 03:27:43 +0000
commit098cc19954286f9c9814cdf203af92cc7e3574c7 (patch)
tree3d5399638032061347e0666bcc6d530b60076d3c
parent71bb4b36544de1a76edbc299dd45087a8db91587 (diff)
Fix calculation of PLT entry index. Caused segfaults on second call
of a lib function.
-rw-r--r--ldso/ldso/powerpc/elfinterp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c
index 77efcd12e..36840fac1 100644
--- a/ldso/ldso/powerpc/elfinterp.c
+++ b/ldso/ldso/powerpc/elfinterp.c
@@ -198,13 +198,17 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
(unsigned long)tpnt->loadaddr;
lbranch_addr = plt_addr + PLT_LONGBRANCH_ENTRY_WORDS*4;
delta = lbranch_addr - insn_addr;
- index = (insn_addr - plt_addr - PLT_INITIAL_ENTRY_WORDS*4)/2;
+ index = (insn_addr - plt_addr - PLT_INITIAL_ENTRY_WORDS*4)/8;
ptr = (unsigned long *)tpnt->data_words;
DPRINTF("plt_addr=%x delta=%x index=%x ptr=%x\n",
plt_addr, delta, index, ptr);
ptr[index] = targ_addr;
- PPC_SYNC;
+ /* icache sync is not necessary, since this will be a data load */
+ //PPC_DCBST(ptr+index);
+ //PPC_SYNC;
+ //PPC_ICBI(ptr+index);
+ //PPC_ISYNC;
insns[1] = OPCODE_B(delta - 4);
}
@@ -212,6 +216,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
PPC_DCBST(insn_addr);
PPC_SYNC;
PPC_ICBI(insn_addr);
+ PPC_ISYNC;
return targ_addr;
}