diff --git a/src/cmd/5l/obj.c b/src/cmd/5l/obj.c index caa13ae7134..5dbd7655c5c 100644 --- a/src/cmd/5l/obj.c +++ b/src/cmd/5l/obj.c @@ -104,7 +104,9 @@ main(int argc, char *argv[]) ARGBEGIN { default: c = ARGC(); - if(c >= 0 && c < sizeof(debug)) + if(c == 'l') + usage(); + if(c >= 0 && c < sizeof(debug)) debug[c]++; break; case 'o': @@ -136,7 +138,6 @@ main(int argc, char *argv[]) break; case 'u': /* produce dynamically loadable module */ dlm = 1; - debug['l']++; if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1])) readundefs(ARGF(), SIMPORT); break; @@ -259,9 +260,7 @@ main(int argc, char *argv[]) lastp = firstp; addlibpath("command line", "command line", argv[0], "main"); - - if(!debug['l']) - loadlib(); + loadlib(); // mark some functions that are only referenced after linker code editing // TODO(kaib): this doesn't work, the prog can't be found in runtime diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c index edae1c618cd..537ef9e9aa7 100644 --- a/src/cmd/6l/obj.c +++ b/src/cmd/6l/obj.c @@ -100,7 +100,9 @@ main(int argc, char *argv[]) ARGBEGIN { default: c = ARGC(); - if(c >= 0 && c < sizeof(debug)) + if(c == 'l') + usage(); + if(c >= 0 && c < sizeof(debug)) debug[c]++; break; case 'o': /* output to (next arg) */ @@ -131,7 +133,6 @@ main(int argc, char *argv[]) break; case 'u': /* produce dynamically loadable module */ dlm = 1; - debug['l']++; if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1])) readundefs(ARGF(), SIMPORT); break; @@ -347,9 +348,7 @@ main(int argc, char *argv[]) lastp = firstp; addlibpath("command line", "command line", argv[0], "main"); - - if(!debug['l']) - loadlib(); + loadlib(); deadcode(); diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c index 7b8e7f2eca1..6ab48622cd5 100644 --- a/src/cmd/8l/obj.c +++ b/src/cmd/8l/obj.c @@ -105,7 +105,9 @@ main(int argc, char *argv[]) ARGBEGIN { default: c = ARGC(); - if(c >= 0 && c < sizeof(debug)) + if(c == 'l') + usage(); + if(c >= 0 && c < sizeof(debug)) debug[c]++; break; case 'o': /* output to (next arg) */ @@ -137,7 +139,6 @@ main(int argc, char *argv[]) break; case 'u': /* produce dynamically loadable module */ dlm = 1; - debug['l']++; if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1])) readundefs(ARGF(), SIMPORT); break; @@ -385,9 +386,7 @@ main(int argc, char *argv[]) lastp = firstp; addlibpath("command line", "command line", argv[0], "main"); - - if(!debug['l']) - loadlib(); + loadlib(); deadcode(); diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index df0b1a7487e..a11ab903817 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -35,8 +35,8 @@ int iconv(Fmt*); char symname[] = SYMDEF; -char* libdir[16] = { "." }; -int nlibdir = 1; +char* libdir[16]; +int nlibdir = 0; int cout = -1; char* goroot; @@ -180,6 +180,11 @@ addlibpath(char *srcref, char *objref, char *file, char *pkg) for(i=0; i= 0) { + addlibpath("internal", "internal", pname, "runtime"); + found = 1; + break; + } + } + if(!found) Bprint(&bso, "warning: unable to find runtime.a\n"); loop: xrefresolv = 0;