mirror of
https://github.com/burrowers/garble.git
synced 2025-12-24 12:58:05 +08:00
add a testscript with the linknames that bytedance/sonic/loader has
For #898.
This commit is contained in:
committed by
Paul Scheduikat
parent
b34a7e3926
commit
db4c8e52d5
2
testdata/script/linkname.txtar
vendored
2
testdata/script/linkname.txtar
vendored
@@ -190,4 +190,4 @@ renamed func
|
||||
featuring Dante from the Devil May Cry series
|
||||
3
|
||||
obfuscated func
|
||||
to this
|
||||
to this
|
||||
|
||||
30
testdata/script/linkname_forbid.txtar
vendored
Normal file
30
testdata/script/linkname_forbid.txtar
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
# TODO: Disallow certain kinds of runtime linknaming which break with garble.
|
||||
|
||||
exec garble build
|
||||
exec ./main
|
||||
|
||||
[short] stop # no need to verify this with -short
|
||||
|
||||
go build
|
||||
exec ./main
|
||||
|
||||
-- go.mod --
|
||||
module test/main
|
||||
|
||||
go 1.23
|
||||
-- linkname_runtime.go --
|
||||
package main
|
||||
|
||||
import _ "unsafe"
|
||||
|
||||
// Note that it doesn't matter that the struct here is empty,
|
||||
// as the linknames below only use pointers to it.
|
||||
type moduledata struct {}
|
||||
|
||||
//go:linkname lastmoduledatap runtime.lastmoduledatap
|
||||
var lastmoduledatap *moduledata
|
||||
|
||||
//go:linkname moduledataverify1 runtime.moduledataverify1
|
||||
func moduledataverify1(_ *moduledata)
|
||||
|
||||
func main() {}
|
||||
Reference in New Issue
Block a user