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
pagran 7c50979899
ensure that all imports are used after obfuscation
garble's -literals flag and its patching of the runtime may leave unused imports.
We used to try to detect those and remove the imports,
but that was still buggy with edge cases like dot imports or renamed imports.

Moreover, it was potentially incorrect.
Completely removing an import from a package means we don't run its init funcs,
which could have side effects changing the behavior of a program.
As an example, database/sql drivers are registered at init time.

Instead, for each import in an obfuscated Go file,
add an unnamed declaration which references the imported package.
This may not be necessary for all imported packages,
as only a minority become unused due to garble,
but it's also relatively harmless to do so.

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