Subject: Patch for lib/csu/mips
To: None <port-pmax@NetBSD.ORG>
From: Arne Henrik Juul <arnej@phys.unit.no>
List: port-pmax
Date: 05/15/1995 14:07:27
[I think my mailer screwed up this earlier - sorry if you see it twice.]

When we use the no-leading-underscore toolchain for mips we can't
really use just 'start' as the introducing symbol - it's in the
user's namespace.  We could possibly use _start, but some programs
in the netbsd tree use that as a global variable (vfontedpr at
least).  I've checked with IRIX and Ultrix and they use __start,
so I think that should be OK for us as well.  I've made a simple
patch that also preserves usage of 'start' if/when compiling with
a leading-underscore toolchain. This patch also fixes the annoying
Makefile bug.

 - Yours,
   Arne H. Juul

diff -ru csu.mips-orig/crt0.S csu.mips/crt0.S
--- csu.mips-orig/crt0.S Mon May 15 03:00:57 1995
+++ csu.mips/crt0.S Mon May 15 03:02:34 1995
@@ -47,6 +47,9 @@
  .word 0  # null string plus padding
  .text
 
+#if __NO_LEADING_UNDERSCORES__
+#define start __start
+#endif
 NON_LEAF(start, 24, ra)
  .set noreorder
 #ifdef __GP_SUPPORT__
diff -ru csu.mips-orig/Makefile csu.mips/Makefile
--- csu.mips-orig/Makefile Mon May 15 03:00:56 1995
+++ csu.mips/Makefile Mon May 15 03:02:04 1995
@@ -13,7 +13,7 @@
  mv a.out ${.TARGET}
 
 gcrt0.o: crt0.S
- ${COMPILE.S} -DMCRT0 ${.ALLSRC}
+ ${COMPILE.S} -DMCRT0 ${.ALLSRC} -o ${.TARGET}
  ${LD} -x -r ${.TARGET}
  mv a.out ${.TARGET}