Add a comment that explains that
. this function cannot have _PROF_PROLOGUE . this function cannot be called via PLT Change ENTRY to NENTRY for the former. XXX: The latter is important in the gcc3 world, that have shared libraries. We will need to play tricks with .hidden to make sure every shared library gets its own private __udivsi3 that it can call directly, without going through the PLT.
This commit is contained in:
parent
c171c20800
commit
2194ee2027
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: udivsi3.S,v 1.5 2003/08/07 16:42:19 agc Exp $ */
|
||||
/* $NetBSD: udivsi3.S,v 1.6 2003/08/27 15:03:06 uwe Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -36,11 +36,30 @@
|
|||
|
||||
#include <machine/asm.h>
|
||||
#if defined(LIBC_SCCS)
|
||||
RCSID("$NetBSD: udivsi3.S,v 1.5 2003/08/07 16:42:19 agc Exp $")
|
||||
RCSID("$NetBSD: udivsi3.S,v 1.6 2003/08/27 15:03:06 uwe Exp $")
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IMPOTANT: This function is special.
|
||||
*
|
||||
* This function is an auxiliary function that is referenced by the
|
||||
* code generated by gcc for integer division. But gcc does NOT treat
|
||||
* a call to this function as an ordinary function call w.r.t. the set
|
||||
* of register this call clobbers. See the definition of "udivsi3_i1"
|
||||
* in gcc/config/sh/sh.md.
|
||||
*
|
||||
* Any call to this function MUST NOT clobber any registers besides r4
|
||||
* and r0, where the result is returned. At the time of the call the
|
||||
* r4 contains the first argument, so we are only left with r0, and we
|
||||
* cannot do anything meaningful using only one register. The
|
||||
* consequences are:
|
||||
*
|
||||
* . this function cannot have _PROF_PROLOGUE
|
||||
* . this function cannot be called via PLT
|
||||
*/
|
||||
|
||||
/* r0 <= r4 / r5 */
|
||||
ENTRY(__udivsi3)
|
||||
NENTRY(__udivsi3)
|
||||
tst r5, r5
|
||||
bt div_by_zero
|
||||
|
||||
|
|
Loading…
Reference in New Issue