Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/crunch/crunchgen Fix PR#4980 and support common symb...



details:   https://anonhg.NetBSD.org/src/rev/51c900d0089b
branches:  trunk
changeset: 556814:51c900d0089b
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sun Dec 28 09:21:36 2003 +0000

description:
Fix PR#4980 and support common symbols correctly in crunched programs.
Exclude them from renaming and expect the linker to do the right thing in
resolving them all to the library copy (i.e. optarg) or locally as the
case may be. Testing multiple programs crunched which reference optarg shows
correct behavior now.

diffstat:

 usr.bin/crunch/crunchgen/crunchgen.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r a4b340149ccc -r 51c900d0089b usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Sun Dec 28 06:50:42 2003 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Sun Dec 28 09:21:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.54 2003/12/27 22:28:38 jmc Exp $       */
+/*     $NetBSD: crunchgen.c,v 1.55 2003/12/28 09:21:36 jmc Exp $       */
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: crunchgen.c,v 1.54 2003/12/27 22:28:38 jmc Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.55 2003/12/28 09:21:36 jmc Exp $");
 #endif
 
 #include <stdlib.h>
@@ -939,12 +939,13 @@
     else
            fprintf(outmk, "%s.cro: %s_stub.o ${%s_OBJPATHS}\n",
                p->name, p->name, p->ident);
-    fprintf(outmk, "\t${LD} -dc -r -o %s.cro %s_stub.o $(%s_OBJPATHS)\n", 
+    fprintf(outmk, "\t${LD} -r -o %s.cro %s_stub.o $(%s_OBJPATHS)\n", 
            p->name, p->name, p->ident);
 #ifdef NEW_TOOLCHAIN
 #ifdef RENAME_SYMS
-    fprintf(outmk, "\t${NM} -ng %s.cro | grep -wv U | ", p->name);
-    fprintf(outmk, "grep -vw _crunched_%s_stub | ", p->ident);
+    fprintf(outmk, "\t${NM} -ng %s.cro | grep -v '^ *U' | ", p->name);
+    fprintf(outmk, "grep -v '^[0-9a-fA-F][0-9a-fA-F]* C' | ");
+    fprintf(outmk, "grep -wv _crunched_%s_stub | ", p->ident);
     for (lst = p->keepsymbols; lst != NULL; lst = lst->next)
        fprintf(outmk, "grep -vw %s | ", lst->str);
     fprintf(outmk, "env CRO=%s.cro awk "



Home | Main Index | Thread Index | Old Index