diff options
author | David Schleef <ds@schleef.org> | 2001-11-26 03:27:43 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2001-11-26 03:27:43 +0000 |
commit | 098cc19954286f9c9814cdf203af92cc7e3574c7 (patch) | |
tree | 3d5399638032061347e0666bcc6d530b60076d3c /ldso | |
parent | 71bb4b36544de1a76edbc299dd45087a8db91587 (diff) |
Fix calculation of PLT entry index. Caused segfaults on second call
of a lib function.
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/powerpc/elfinterp.c | 9 |
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; } |