Don't use %d2 (violates the ABI since it wasn't saved), use %a0 instead.

Use a pcrelative access for the local data avoiding the GOT.
This commit is contained in:
matt 2013-07-18 12:16:40 +00:00
parent 8dce5128ed
commit 547d5de4df
1 changed files with 5 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: random.S,v 1.4 2009/01/06 01:24:56 pooka Exp $ */
/* $NetBSD: random.S,v 1.5 2013/07/18 12:16:40 matt Exp $ */
/*
* Copyright (c) 1990,1993 The Regents of the University of California.
@ -48,22 +48,14 @@ ASLOCAL(randseed)
ENTRY(random)
movl #16807, %d0
#ifdef PIC
lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC), %a0
movl _ASM_LABEL(randseed)@GOT(%a0), %d2
mulsl (%d2), %d1:%d0
#else
mulsl _ASM_LABEL(randseed), %d1:%d0
#endif
LEA_LCL(_ASM_LABEL(randseed),%a0)
mulsl (%a0), %d1:%d0
lsll #1, %d0
roxll #2, %d1
addl %d1, %d0
moveql #1, %d1
addxl %d1, %d0
lsrl #1, %d0
#ifdef PIC
movl %d0, (%d2)
#else
movl %d0, _ASM_LABEL(randseed)
#endif
movl %d0, (%a0)
rts
END(random)