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 Add special command "keepsymbols", ...
details: https://anonhg.NetBSD.org/src/rev/47c4b73f0bb1
branches: trunk
changeset: 521166:47c4b73f0bb1
user: ragge <ragge%NetBSD.org@localhost>
date: Fri Jan 25 12:05:00 2002 +0000
description:
Add special command "keepsymbols", allows the specified external symbols
not to be hidden. From Jens Nilsson, jens%rockstorm.se@localhost.
diffstat:
usr.bin/crunch/crunchgen/crunchgen.1 | 7 ++++++-
usr.bin/crunch/crunchgen/crunchgen.c | 27 +++++++++++++++++++--------
2 files changed, 25 insertions(+), 9 deletions(-)
diffs (99 lines):
diff -r 45452ffaea22 -r 47c4b73f0bb1 usr.bin/crunch/crunchgen/crunchgen.1
--- a/usr.bin/crunch/crunchgen/crunchgen.1 Fri Jan 25 05:21:40 2002 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.1 Fri Jan 25 12:05:00 2002 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: crunchgen.1,v 1.14 2001/12/01 19:02:07 wiz Exp $
+.\" $NetBSD: crunchgen.1,v 1.15 2002/01/25 12:05:00 ragge Exp $
.\"
.\" Copyright (c) 1994 University of Maryland
.\" All Rights Reserved.
@@ -168,6 +168,11 @@
.Nm
parameters for a component program.
.Bl -tag -width indent
+.It Nm special Ar progname Nm keepsymbols Ar symbols ...
+Don't hide the specified symbols for
+.Ar progname .
+Normally all externally visible symbols for
+a program is hidden to avoid interference.
.It Nm special Ar progname Nm srcdir Ar pathname
Set the source directory for
.Ar progname .
diff -r 45452ffaea22 -r 47c4b73f0bb1 usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c Fri Jan 25 05:21:40 2002 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c Fri Jan 25 12:05:00 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crunchgen.c,v 1.29 2001/11/08 07:35:00 jmc Exp $ */
+/* $NetBSD: crunchgen.c,v 1.30 2002/01/25 12:05:00 ragge Exp $ */
/*
* Copyright (c) 1994 University of Maryland
* All Rights Reserved.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: crunchgen.c,v 1.29 2001/11/08 07:35:00 jmc Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.30 2002/01/25 12:05:00 ragge Exp $");
#endif
#include <stdlib.h>
@@ -69,7 +69,7 @@
char *name, *ident;
char *srcdir, *objdir;
strlst_t *objs, *objpaths;
- strlst_t *links;
+ strlst_t *links, *keepsymbols;
int goterror;
} prog_t;
@@ -363,7 +363,7 @@
else p1->next = p2;
p2->ident = p2->srcdir = p2->objdir = NULL;
- p2->objs = p2->objpaths = p2->links = NULL;
+ p2->objs = p2->objpaths = p2->links = p2->keepsymbols = NULL;
p2->goterror = 0;
}
@@ -442,6 +442,11 @@
for(i=3;i<argc;i++)
add_string(&p->objpaths, argv[i]);
}
+ else if(!strcmp(argv[2], "keepsymbols")) {
+ p->keepsymbols = NULL;
+ for (i=3;i<argc;i++)
+ add_string(&p->keepsymbols, argv[i]);
+ }
else {
fprintf(stderr, "%s:%d: bad parameter name `%s', skipping line.\n",
curfilename, linenum, argv[2]);
@@ -844,6 +849,8 @@
void prog_makefile_rules(FILE *outmk, prog_t *p)
{
+ strlst_t *lst;
+
fprintf(outmk, "\n# -------- %s\n\n", p->name);
fprintf(outmk, "%s_OBJPATHS=", p->ident);
@@ -881,12 +888,16 @@
fprintf(outmk, "\t${LD} -dc -r -o %s.cro %s_stub.o $(%s_OBJPATHS)\n",
p->name, p->name, p->ident);
#ifdef NEW_TOOLCHAIN
- fprintf(outmk, "\t${OBJCOPY} --keep-global-symbol _crunched_%s_stub %s.cro\n",
- p->ident, p->name);
+ fprintf(outmk, "\t${OBJCOPY} --keep-global-symbol _crunched_%s_stub ",
+ p->ident);
+ for (lst = p->keepsymbols; lst != NULL; lst = lst->next)
+ fprintf(outmk, "--keep-global-symbol %s ", lst->str);
#else
- fprintf(outmk, "\t${CRUNCHIDE} -k _crunched_%s_stub %s.cro\n",
- p->ident, p->name);
+ fprintf(outmk, "\t${CRUNCHIDE} -k _crunched_%s_stub ", p->ident);
+ for (lst = p->keepsymbols; lst != NULL; lst = lst->next)
+ fprintf(outmk, "-k %s ", lst->str);
#endif
+ fprintf(outmk, "%s.cro\n", p->name);
}
void output_strlst(FILE *outf, strlst_t *lst)
Home |
Main Index |
Thread Index |
Old Index