1
0
mirror of https://github.com/golang/go synced 2024-11-22 07:14:40 -07:00

5l, 6l, 8l: accept only one object file

(package main; others are pulled in automatically)

R=ken2
CC=golang-dev
https://golang.org/cl/194069
This commit is contained in:
Russ Cox 2010-01-25 17:53:43 -08:00
parent dc061ffcbe
commit 3b1a0355b6
4 changed files with 13 additions and 15 deletions

View File

@ -80,7 +80,7 @@ linkername[] =
void void
usage(void) usage(void)
{ {
fprint(2, "usage: 5l [-options] objects\n"); fprint(2, "usage: 5l [-options] main.5\n");
errorexit(); errorexit();
} }
@ -144,7 +144,7 @@ main(int argc, char *argv[])
USED(argc); USED(argc);
if(*argv == 0) if(argc != 1)
usage(); usage();
libinit(); libinit();
@ -258,8 +258,8 @@ main(int argc, char *argv[])
firstp = prg(); firstp = prg();
lastp = firstp; lastp = firstp;
while(*argv) objfile(argv[0], "main");
objfile(*argv++, "main");
if(!debug['l']) if(!debug['l'])
loadlib(); loadlib();

View File

@ -76,7 +76,7 @@ isobjfile(char *f)
void void
usage(void) usage(void)
{ {
fprint(2, "usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] files...\n"); fprint(2, "usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] main.6\n");
exits("usage"); exits("usage");
} }
@ -136,8 +136,8 @@ main(int argc, char *argv[])
readundefs(ARGF(), SIMPORT); readundefs(ARGF(), SIMPORT);
break; break;
} ARGEND } ARGEND
USED(argc);
if(*argv == 0) if(argc != 1)
usage(); usage();
libinit(); libinit();
@ -346,8 +346,7 @@ main(int argc, char *argv[])
firstp = prg(); firstp = prg();
lastp = firstp; lastp = firstp;
while(*argv) objfile(argv[0], "main");
objfile(*argv++, "main");
if(!debug['l']) if(!debug['l'])
loadlib(); loadlib();

View File

@ -81,7 +81,7 @@ isobjfile(char *f)
void void
usage(void) usage(void)
{ {
fprint(2, "usage: 8l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] files...\n"); fprint(2, "usage: 8l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] main.8\n");
exits("usage"); exits("usage");
} }
@ -142,8 +142,8 @@ main(int argc, char *argv[])
readundefs(ARGF(), SIMPORT); readundefs(ARGF(), SIMPORT);
break; break;
} ARGEND } ARGEND
USED(argc);
if(*argv == 0) if(argc != 1)
usage(); usage();
mywhatsys(); // get goos mywhatsys(); // get goos
@ -384,8 +384,7 @@ main(int argc, char *argv[])
firstp = prg(); firstp = prg();
lastp = firstp; lastp = firstp;
while(*argv) objfile(argv[0], "main");
objfile(*argv++, "main");
if(!debug['l']) if(!debug['l'])
loadlib(); loadlib();

View File

@ -1,4 +1,4 @@
// $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A x.$A && ./$A.out // $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A && ./$A.out
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style