Subject: Libraries in standalone programs (pmax/ELF specific?)
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@telstra.com.au>
List: tech-kern
Date: 03/31/1999 16:43:18
Folks,

I'm not sure what to do here.  For the pmax bootblocks, I'm linking
against the following list of libraries:

	LIBS=  ${LIBPMAX} ${LIBKERN} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBPMAX}

The reason I need such a convoluted list is that library members of
some earlier libraries need members that occur in earlier members but
aren't getting picked up.

For example, if I leave off the trailing ${LIBPMAX}, putchar is
undefined because something in ${LIBSA} refers to it.  Is there an
easier/better way of doing this?


Also, while on the topic of small things, does anyone have a
problem from a stylistic POV I make the following change to
stand/libsa/memcpy.c?  On the pmax, this generates slightly
smaller code.

	Index: memcpy.c
	===================================================================
	RCS file: /cvsroot/src/sys/lib/libsa/memcpy.c,v
	retrieving revision 1.3
	diff -u -r1.3 memcpy.c
	--- memcpy.c	1999/03/31 01:39:16	1.3
	+++ memcpy.c	1999/03/31 06:32:40
	@@ -50,7 +50,7 @@
		register const char *f = s2;
		register char *t = s1;
	 
	-	while (n-- > 0)
	+	while (n--)
			*t++ = *f++;
		return (s1);
	 }

It actually generates just one less instruction, but that extra
instruction adds 16 bytes to the code size...

Simon.