From 0830f64bf0a95c310b6396ea53279b17e35f82ad Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 18 Dec 2013 10:33:47 -0800 Subject: [PATCH] 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 --- src/liblink/ld.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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); -- 2.48.1