Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement unexported func name removing #633

Merged
merged 4 commits into from Jan 9, 2023
Merged

Conversation

pagran
Copy link
Member

@pagran pagran commented Jan 8, 2023

Removing unexportable function names is implemented by this algorithm:

  1. Allocate 1 byte for empty string and write to runtime.funcnametab by 0 offset
  2. While iterating over functions during runtime.funcnametab creation, all non-exportable function names are forwarded to 0 offset, i.e. to correct empty string

Stats (GOOS=linux):

command size
go build 1203067
garble build 782336
garble -tiny build 688128
NEW garble -tiny build 659456

@pagran pagran requested review from mvdan and lu4p and removed request for mvdan January 8, 2023 20:30
Copy link
Member

@lu4p lu4p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

internal/linker/linker.go Outdated Show resolved Hide resolved
testdata/script/tiny.txtar Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@pagran
Copy link
Member Author

pagran commented Jan 8, 2023

Since git apply supports multiple patches in stdin, I will rewrite applying algorithm tomorrow, please do not merge yet @mvdan

internal/linker/linker.go Outdated Show resolved Hide resolved
internal/linker/linker.go Outdated Show resolved Hide resolved
internal/linker/linker.go Outdated Show resolved Hide resolved
internal/linker/linker.go Show resolved Hide resolved
@pagran pagran requested a review from mvdan January 9, 2023 09:44
internal/linker/linker.go Outdated Show resolved Hide resolved
@pagran pagran requested a review from mvdan January 9, 2023 11:04
Copy link
Member

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. want to squash with a commit message?

@pagran
Copy link
Member Author

pagran commented Jan 9, 2023

SGTM. want to squash with a commit message?

You better do it :)

@mvdan mvdan merged commit 22c177f into burrowers:master Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants