Index: head/sys/powerpc/powerpc/machdep.c =================================================================== --- head/sys/powerpc/powerpc/machdep.c +++ head/sys/powerpc/powerpc/machdep.c @@ -530,6 +530,10 @@ saved_sprno = sprno = (intptr_t) addr; sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5); p = (uint32_t *)(void *)&get_spr; +#if defined(_CALL_ELF) && _CALL_ELF == 2 + /* Account for ELFv2 function prologue. */ + p += 2; +#endif *p = (*p & ~0x001ff800) | (sprno << 11); __syncicache(get_spr, cacheline_size); spr = get_spr(sprno);