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í 9c0cdc61ef avoid reflect method call panics with GOGARBLE=*
We were obfuscating reflect's package path and its declared names,
but the toolchain wants to detect the presence of method reflection
to turn down the aggressiveness of dead code elimination.

Given that the obfuscation broke the detection,
we could easily end up in crashes when making reflect calls:

	fatal error: unreachable method called. linker bug?

	goroutine 1 [running]:
	runtime.throw({0x50c9b3?, 0x2?})
		runtime/panic.go:1047 +0x5d fp=0xc000063660 sp=0xc000063630 pc=0x43245d
	runtime.unreachableMethod()
		runtime/iface.go:532 +0x25 fp=0xc000063680 sp=0xc000063660 pc=0x40a845
	runtime.call16(0xc00010a360, 0xc00000e0a8, 0x0, 0x0, 0x0, 0x8, 0xc000063bb0)
		runtime/wcS9OpRFL:728 +0x49 fp=0xc0000636a0 sp=0xc000063680 pc=0x45eae9
	runtime.reflectcall(0xc00001c120?, 0x1?, 0x1?, 0x18110?, 0xc0?, 0x1?, 0x1?)
		<autogenerated>:1 +0x3c fp=0xc0000636e0 sp=0xc0000636a0 pc=0x462e9c

Avoid obfuscating the three names which cause problems: "reflect",
"Method", and "MethodByName".

While here, we also teach obfuscatedImportPath to skip "runtime",
as I also saw that the toolchain detects it for many reasons.
That wasn't a problem yet, as we do not obfuscate the runtime,
but it was likely going to become a problem in the future.
3 years ago
..
asm.txtar default to GOGARBLE=*, stop using GOPRIVATE 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 default to GOGARBLE=*, stop using GOPRIVATE 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
linkname.txtar default to GOGARBLE=*, stop using GOPRIVATE 3 years ago
literals.txtar default to GOGARBLE=*, stop using GOPRIVATE 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 default to GOGARBLE=*, stop using GOPRIVATE 3 years ago
seed-cache.txtar default to GOGARBLE=*, stop using GOPRIVATE 3 years ago
seed.txtar default to GOGARBLE=*, stop using GOPRIVATE 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 default to GOGARBLE=*, stop using GOPRIVATE 3 years ago
typeparams.txtar default to GOGARBLE=*, stop using GOPRIVATE 3 years ago