fix two problems with icache invalidation of the PLT:

- restore revision 1.33, it was correct.
 - fix pointer arithmetic in other calls to __syncicache().
This commit is contained in:
chs 2005-09-26 05:45:13 +00:00
parent 2cbe95f3ac
commit 96fb424f44

View File

@ -1,4 +1,4 @@
/* $NetBSD: ppc_reloc.c,v 1.37 2005/08/20 19:01:17 skrll Exp $ */
/* $NetBSD: ppc_reloc.c,v 1.38 2005/09/26 05:45:13 chs Exp $ */
/*-
* Copyright (C) 1998 Tsubai Masanari
@ -30,7 +30,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ppc_reloc.c,v 1.37 2005/08/20 19:01:17 skrll Exp $");
__RCSID("$NetBSD: ppc_reloc.c,v 1.38 2005/09/26 05:45:13 chs Exp $");
#endif /* not lint */
#include <stdarg.h>
@ -89,7 +89,7 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
pltresolve[3] |= ha(obj);
pltresolve[4] |= l(obj);
__syncicache(pltcall, 72 + N * 8);
__syncicache(pltcall, 72 + N * 12);
}
void
@ -218,7 +218,7 @@ _rtld_relocate_plt_lazy(const Obj_Entry *obj)
/* b pltresolve */
distance = (Elf_Addr)pltresolve - (Elf_Addr)where;
*where++ = 0x48000000 | (distance & 0x03fffffc);
/* __syncicache(where - 12, 12); */
/* __syncicache(where - 3, 12); */
}
return 0;
@ -273,7 +273,7 @@ _rtld_relocate_plt_object(const Obj_Entry *obj, const Elf_Rela *rela, int reloff
/* b pltcall */
distance = (Elf_Addr)pltcall - (Elf_Addr)where;
*where++ = 0x48000000 | (distance & 0x03fffffc);
__syncicache(where - 12, 12);
__syncicache(where - 3, 12);
}
if (tp)