6 Commits

Author SHA1 Message Date
Daniel Martí 2322872d3b avoid obfuscating crypto/internal/fips140/...
Attempting to fix a failure on GOOS=darwin:

    > exec garble -literals build std
    [stderr]
    # crypto/internal/fips140
    <autogenerated>:1: crypto/internal/fips140.YVgfcHoMsU1M.func1.jump7: invalid relocation R_ADDR in fips data (SDATAFIPS)

And other failures I was seeing on Linux relating to `var RODATA`.
2026-03-15 23:36:56 +01:00
Daniel Martí 7114403786 drop Go 1.25, support Go 1.26
Beyond the usual updating of version strings, re-running `go generate`,
and updating the patches for the linker, we needed extra changes.

First, the linker started being stricter about which packages
are allowed to linkname runtime names by import path.
Stop obfuscating import paths in runtimeAndLinknamed.

Second, the compiler's intrinsics code adds an "add" function
much like the existing "addF", so tweak the regular expression.

Third, note that there is a new runtimeAndDeps windows-only package,
which we find thanks to the recent improvement to cover many platforms.

Fourth, the code around magic numbers in the runtime has changed,
so rewrite the code which patches it via go/ast.

Fixes #990.
2026-03-15 23:36:56 +01:00
Daniel Martí 529ee19380 improve go_std_tables.go generation
Make runtimeAndLinknamed a set, like the other tables, for easy lookups
which will come in handy for Go 1.26 support.

Run `go list` across multiple platforms to ensure we cover all bases.
This again will help for Go 1.26 support, which introduces more
packages specific to MacOS and Windows.
2026-03-15 23:36:56 +01:00
Daniel Martí 9d7c84b0c6 parse go env GOVERSION with go/version directly
We don't need to use a regular expression to find "goN.M" anymore,
as go/version seems to deal with "devel" versions from master just fine.
We can then also stop having two separate fields for the version
of the Go toolchain currently being used.
2025-10-18 06:42:52 +02:00
Daniel Martí 33e574685b support reversing asm filenames
Which can be helpful when debugging assembly build errors
such as the one from #948.
I could not get an obfuscated binary to ever print or show its
assembly positions or filenames, so this has no test.
2025-09-09 01:57:17 +01:00
jtimperio 28f7a7ffbf refactor main into pieces
* reflect_abi_patch.go was added into reflect.go
* shared.go was renamed into cache_shared.go and package caching was moved to cache_pkg.go
* transformer methods in main.go are moved to transformer.go
2025-09-09 00:28:15 +01:00