]> Cypherpunks repositories - gostls13.git/commit
cmd/link: with -importcfg don't strip trailing ".a"
authorIan Lance Taylor <iant@golang.org>
Tue, 5 Dec 2017 07:10:56 +0000 (23:10 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 12 Dec 2017 04:55:56 +0000 (04:55 +0000)
commitd1be0fd910758852584ab53d2c92c4caac3f5b7e
treeed5e60e05b028264b6e7d8282a2d2d4eb73819b3
parent943e2635b304a24c001c793f22ff4493cc077daa
cmd/link: with -importcfg don't strip trailing ".a"

When using -importcfg, the import paths recorded by the compiler in
the object file are simply the import paths. When not using -importcfg,
the import paths have a trailing ".a". Assume that if we are using
-importcfg with the compiler, we are using it with the linker,
and so if the linker sees an -importcfg option it should not
strip ".a" from the import path read from the object files.

This was mostly working because the linker only strips a trailing
".x" for a literal dot and any single character 'x'. Since few import
paths end with ".x", most programs worked fine.

Fixes #22986

Change-Id: I6c10a160b97dd63fff3931f27a1514c856e8cd52
Reviewed-on: https://go-review.googlesource.com/81878
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/go_test.go
src/cmd/link/internal/ld/ld.go