You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/script
Daniel Martí 5dd6b2dc43 support assembly references to package names
Go's package runtime/internal/atomic contains references to functions
which refer to the current package by its package name alone:

	src/runtime/internal/atomic/atomic_loong64.s:   JMP atomic·Load(SB)
	src/runtime/internal/atomic/atomic_loong64.s:   JMP atomic·Load64(SB)
	src/runtime/internal/atomic/atomic_loong64.s:   JMP atomic·Load64(SB)
	src/runtime/internal/atomic/atomic_mips64x.s:   JMP atomic·Load(SB)
	src/runtime/internal/atomic/atomic_mips64x.s:   JMP atomic·Load64(SB)
	src/runtime/internal/atomic/atomic_mips64x.s:   JMP atomic·Load64(SB)

We could only handle unqualified or fully qualified references, like:

	JMP ·Load64(SB)
	JMP runtime∕internal∕atomic·Load64(SB)

Apparently, all three forms are equally valid.
Add a test case and fix it.

I checked whether referencing an imported package by its name worked;
it does not seem to be the case.
This feature appears to be restricted to the current package alone.

While here, we only need goPkgPath when we need to call listPackage.

Fixes #619.
1 year ago
..
asm.txtar support assembly references to package names 1 year ago
basic.txtar drop support for Go 1.18.x 2 years ago
cgo.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
crossbuild.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
debugdir.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
embed.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
goenv.txtar drop support for Go 1.18.x 2 years ago
gogarble.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
goversion.txtar drop support for Go 1.18.x 2 years ago
help.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
implement.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
imports.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
init.txtar drop support for Go 1.18.x 2 years ago
ldflags.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
linker.txtar patch and rebuild cmd/link to modify the magic value in pclntab 2 years ago
linkname.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
literals.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
modinfo.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
plugin.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
position.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
reflect.txtar avoid reflect method call panics with GOGARBLE=* 2 years ago
reverse.txtar CI: bump gotip to December 2022 2 years ago
seed-cache.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
seed.txtar make seed.txtar less likely to flake 1 year ago
syntax.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago
test.txtar support `garble test` in main packages 2 years ago
tiny.txtar remove all unexported func names with -tiny via the linker 1 year ago
typeparams.txtar default to GOGARBLE=*, stop using GOPRIVATE 2 years ago