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

About judging whether golang abi is register-based #262

Closed
Hackerl opened this issue Nov 8, 2022 · 4 comments · Fixed by #295
Closed

About judging whether golang abi is register-based #262

Hackerl opened this issue Nov 8, 2022 · 4 comments · Fixed by #295
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Hackerl
Copy link

Hackerl commented Nov 8, 2022

https://github.com/ehids/ecapture/blob/4c74089056dd2ec65b05665d021f6ba68055588a/user/module/probe_gossl.go#L43

golang uses register-based abi since 1.17(x64), minimum versions for other architectures require further confirmation.
Also, to read the version of golang binary, you can use debug/buildinfo.

@cfc4n cfc4n added good first issue Good for newcomers help wanted Extra attention is needed labels Nov 8, 2022
@cfc4n
Copy link
Member

cfc4n commented Nov 9, 2022

Does it still exist while use -ldflags "-s" ?

@Hackerl
Copy link
Author

Hackerl commented Nov 9, 2022

.go.buildinfo section exists in every golang binary above 1.13, this is also how the go version command works。

@cfc4n
Copy link
Member

cfc4n commented Nov 15, 2022

in golang 1.18 , buildinfo.ReadFile can get go Version. but eCapture used golang 1.17 now . I'm still hesitating that keep use elf.File.DWARF() or update to 1.18 to use buildinfo.ReadFile.
perhaps we can wating for new Cilium/ebpf version about #253 , then I will update golang new version for them.

bi, e := buildinfo.ReadFile(path)
if e != nil {
return nil, ErrVersionNotFound
}
fmt.Println(bi.GoVersion)

@cfc4n
Copy link
Member

cfc4n commented Jan 17, 2023

thanks for @Hackerl , It's fixed. and eCapture updated golang version to 1.18.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants