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í 1c4fe53fc1 skip over comments when obfuscating assembly
github.com/bytedance/sonic has many comments in its assembly files,
and one in particular caused us trouble:

	internal/rt/asm_amd64.s:2:// Code generated by asm2asm, DO NOT EDIT·

Since we looked for "middle dot" characters anywhere,
we would try to load the package "EDIT", which clearly does not exist.

To fix that, start skipping over comments. Thankfully,
Go's assembly syntax only supports "//" line comments,
so it's enough to read one line at a time and skip them quickly.
We also longer need a regular expression to find #include lines.

While here, two other minor bits of cleanup.
First, rename transformGo to transformGoFile, for clarity.
Second, use ".s" extensions for obfuscated assembly filenames,
just like we do with the comiler and ".go" files.

Updates #621.
3 years ago
..
asm.txtar skip over comments when obfuscating assembly 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
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 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 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