mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: refactor addlib
* extract pkgname() and findlib() from the function for #18190. * rename const pkgname to const pkgdef to avoid confliction. Change-Id: Ie62509bfbddcf19cf92b5b12b598679a069e6e74 Reviewed-on: https://go-review.googlesource.com/59417 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
738acbc2f0
commit
4eca0898ec
2 changed files with 23 additions and 10 deletions
|
|
@ -242,7 +242,7 @@ func (w *outBuf) Offset() int64 {
|
|||
|
||||
var coutbuf outBuf
|
||||
|
||||
const pkgname = "__.PKGDEF"
|
||||
const pkgdef = "__.PKGDEF"
|
||||
|
||||
var (
|
||||
// Set if we see an object compiled by the host compiler that is not
|
||||
|
|
@ -811,7 +811,7 @@ func objfile(ctxt *Link, lib *Library) {
|
|||
goto out
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(arhdr.name, pkgname) {
|
||||
if !strings.HasPrefix(arhdr.name, pkgdef) {
|
||||
Errorf(nil, "%s: cannot find package header", lib.File)
|
||||
goto out
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue