Commit 3b1a0355 authored by Russ Cox's avatar Russ Cox

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
parent dc061ffc
...@@ -80,7 +80,7 @@ linkername[] = ...@@ -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[]) ...@@ -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[]) ...@@ -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();
......
...@@ -76,7 +76,7 @@ isobjfile(char *f) ...@@ -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[]) ...@@ -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[]) ...@@ -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();
......
...@@ -81,7 +81,7 @@ isobjfile(char *f) ...@@ -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[]) ...@@ -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[]) ...@@ -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();
......
// $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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment