From: Ian Lance Taylor Date: Wed, 18 Dec 2013 18:33:47 +0000 (-0800) Subject: liblink: don't search for an import file with an absolute path X-Git-Tag: go1.3beta1~1168 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0830f64bf0a95c310b6396ea53279b17e35f82ad;p=gostls13.git liblink: don't search for an import file with an absolute path This restores the old behaviour, and makes it possible to continue to use 6g and 6l directly, rather than the go tool, with dot imports. R=rsc CC=golang-dev https://golang.org/cl/43710043 --- diff --git a/src/liblink/ld.c b/src/liblink/ld.c index 1d06f809a4..9ea0e9a732 100644 --- a/src/liblink/ld.c +++ b/src/liblink/ld.c @@ -61,11 +61,15 @@ addlib(Link *ctxt, char *src, char *obj, char *pathname) if(p != nil) *p = '.'; - // try dot, -L "libdir", and then goroot. - for(i=0; inlibdir; i++) { - snprint(pname, sizeof pname, "%s/%s", ctxt->libdir[i], name); - if(access(pname, AEXIST) >= 0) - break; + if((!ctxt->windows && name[0] == '/') || (ctxt->windows && name[1] == ':')) + snprint(pname, sizeof pname, "%s", name); + else { + // try dot, -L "libdir", and then goroot. + for(i=0; inlibdir; i++) { + snprint(pname, sizeof pname, "%s/%s", ctxt->libdir[i], name); + if(access(pname, AEXIST) >= 0) + break; + } } cleanname(pname);