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

docs: explain Go symbol hash #7

Merged
merged 2 commits into from
Oct 31, 2022
Merged

docs: explain Go symbol hash #7

merged 2 commits into from
Oct 31, 2022

Conversation

efd6
Copy link
Collaborator

@efd6 efd6 commented Oct 31, 2022

Put an explicit description of the Go symbol hash algorithm in the godoc and in the README.

For elastic/ecs#2083

Please take a look.

@efd6 efd6 requested a review from andrewkroh October 31, 2022 21:34
Put an explicit description of the Go symbol hash algorithm in the godoc
and in the README.

The `GoSymbolHash` algorithm is analogous to the algorithm described for `ImportHash` with the exception that Go's static symbols are used in place of the dynamic import symbols used by `ImportHash`.

The list of symbols referenced by the executable is obtained and the MD5 hash of the ordered list of symbols, separated by commas, is calculated.
Copy link
Member

Choose a reason for hiding this comment

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

Is this in the order that they are listed in the binary?

Copy link
Collaborator Author

@efd6 efd6 Oct 31, 2022

Choose a reason for hiding this comment

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

This is not specified in the original description of imphash (irritatingly), but is shown in the reference implementation. Yes, it is in appearance order in the binary without additional lexical ordering. Given that I find it irritating that it's not mentioned in imphash, I'll add that detail here.

@efd6 efd6 requested a review from andrewkroh October 31, 2022 23:13
@efd6 efd6 merged commit 5d2efdb into dev Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants