Global constructors using `.section .ctors' are bogus for NetBSD's
assembler. Use the appropriate `.stabs' when on NetBSD.

diff --git a/tools/wrc/writeres.c b/tools/wrc/writeres.c
index f02d39f..b87f465 100644
--- a/tools/wrc/writeres.c
+++ b/tools/wrc/writeres.c
@@ -49,8 +49,12 @@
 #endif
 	"\taddl\t$4,%%esp\n"
 	"\tret\n\n"
+#ifdef __NetBSD__
+	".stabs \"___CTOR_LIST__\",22,0,0,.LAuto_Register\n\n"
+#else
 	"\t.section .ctors,\"aw\"\n"
 	"\t.long\t.LAuto_Register\n\n"
+#endif
 	;
 
 char h_file_head_str[] =