Subject: Re: weird messages?
To: matthew green <mrg@eterna.com.au>
From: Simon Burge <simonb@netbsd.org>
List: port-mips
Date: 11/14/1999 23:41:00
matthew green wrote:

> i'm just building -current on a /260 and i notice is is doing stuff like:
> 
> /orb/v/src/lib/libc/arch/mips/string/bzero.S:56: Warning: No .cprestore pseudo-op used in PIC code
> 
> creating bind.po
> : Assembler messages:
> :2: Warning: No .cprestore pseudo-op used in PIC code
> 
> every syscall.po creation seems to cause it, and a few other .S files...

I looked into this a little further.  Basically, LEAF (and NON_LEAF)
insert a call to _mcount before the .cprestore macro.  AFAICT, a
function prologue is:

	if ABICALLS - cpload
	optionally allocate stack frame
	if ABICALLS - cprestore

To make this interesting rather that just adding cprestore to LEAF, some
functions (like the b* and mem* memory functions) don't do the abicalls
thing at all and only a few allocate a stack frame.

I'll look into this more tomorrow.  I think it'd be best for LEAF and
NON_LEAF to handle this rather than add a PROFILE macro that needs to be
called in every function as well - maybe a LEAF and LEAF_FRAME (and the
corresponding NON_* macros), where LEAF_FRAME takes an extra parameter
to say how large the stack frame should be.  Any hints or suggestions
will be most welcome :)

Simon.