Skip to content

ELFVersion.jl additions #51

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

Merged
merged 3 commits into from
Mar 19, 2025
Merged

Conversation

mlechu
Copy link
Contributor

@mlechu mlechu commented Mar 12, 2025

I used ObjectFile to write a script to patch versions in ELF files and decided some parts of it might belong here.

  • Of the four version definition/requirement structs (verdef, verdaux, verneed, vernaux), we're missing the fourth, so add it
  • Fix ELFVersionData not working if it doesn't find a .gnu.version_d section:
    julia> ELFVersionData(oh)
    ERROR: MethodError: no method matching section_offset(::Nothing)
    The function `section_offset` exists, but no method is defined for this combination of argument types.
    
  • Add ELFVersionNeededData, a similar function for version requirements (.gnu.version_r)
  • Add elf hash function used in version definitions and requirements (see https://en.wikipedia.org/wiki/PJW_hash_function)

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.00%. Comparing base (427b624) to head (c357a27).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   68.09%   69.00%   +0.90%     
==========================================
  Files          46       46              
  Lines        1332     1371      +39     
==========================================
+ Hits          907      946      +39     
  Misses        425      425              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mlechu
Copy link
Contributor Author

mlechu commented Mar 12, 2025

Nightly won't work at the moment due to JuliaLang/julia#57699

@mlechu mlechu marked this pull request as draft March 12, 2025 18:43
@mlechu mlechu force-pushed the elf-version-utils branch from c9463db to 72121f6 Compare March 12, 2025 18:47
@topolarity
Copy link

Can you add some tests for the new functionality? 🙂

@mlechu mlechu force-pushed the elf-version-utils branch from 72121f6 to 4ef64df Compare March 14, 2025 22:24
`ELFVersionNeededData` should produce a list of `ELFVersionNeededEntry` just as
`ELFVersionData` produces a list of `ELFVersionEntry`.  Export both and add
docs + tests.
@mlechu mlechu force-pushed the elf-version-utils branch from 4abb742 to c357a27 Compare March 14, 2025 22:34
@mlechu mlechu marked this pull request as ready for review March 14, 2025 22:35
Copy link

@topolarity topolarity left a comment

Choose a reason for hiding this comment

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

Nice changes! Easy to read, and test coverage looks good.

Thanks much @mlechu !

@topolarity
Copy link

@giordano or @staticfloat , is it possible to get a quick review here?

Changes look complete to me, nightly is only failing because of JuliaLang/julia#57755

Copy link
Collaborator

@staticfloat staticfloat 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 to me!

@staticfloat staticfloat merged commit c8527f4 into JuliaIO:master Mar 19, 2025
13 of 18 checks passed
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.

3 participants