Repository navigation
ELF: allow DynamicLinks() and RPath() on objects with no .dynamic section - #70
Merged
Merged
Conversation
…tion Relocatable objects (`.o`, `ET_REL`) have no `.dynamic` section, so `DynamicLinks(oh)` threw `MethodError: no method matching ELFDynamicLinks(::Nothing, ...)` and `RPath(oh)` (and `ELFDynEntries(oh)`, `find_libraries(oh)`) threw `seekstart(::Nothing)`. `ELFDynEntries` now returns no entries when `.dynamic` is missing. `ELFDynamicLinks` and `ELFRPath` allow `section_ref === nothing` and store the handle themselves, so `handle()` (and therefore `canonical_rpaths()`) still works. The two-argument constructors are kept. `StrTab(::ELFDynamicLinks)` raises an explicit error when there is no `.dynamic` section. The other ELF accessors already handle relocatable objects: Sections, Segments (empty), Symbols (.symtab), StrTab, ELFVersionData, ELFVersionNeededData, isdynamic and Platform. Adds `test/elfobj/foo.o`, a real x86_64 relocatable object generated by `test/elfobj/build.sh`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JnariwhJ27gVWNZnYbst65
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #70 +/- ##
==========================================
- Coverage 73.47% 73.41% -0.06%
==========================================
Files 48 48
Lines 1587 1591 +4
==========================================
+ Hits 1166 1168 +2
- Misses 421 423 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relocatable objects (
.o,ET_REL) have no.dynamicsection, soDynamicLinks(oh)threwMethodError: no method matching ELFDynamicLinks(::Nothing, ...), andRPath(oh),ELFDynEntries(oh)andfind_libraries(oh)threwseekstart(::Nothing).ELFDynEntriesreturns no entries when.dynamicis missing.ELFDynamicLinksandELFRPathallowsection_ref === nothingand store the handle themselves, sohandle()(and thereforecanonical_rpaths()) still works. The two-argument constructors are kept.StrTab(::ELFDynamicLinks)raises an explicit error when there is no.dynamicsection.The other ELF accessors already handle relocatable objects: Sections, Segments, Symbols, StrTab, ELFVersionData, ELFVersionNeededData, isdynamic and Platform.
Adds
test/elfobj/foo.o, a real x86_64 relocatable object generated bytest/elfobj/build.sh. The new testset fails on master. With this change the full suite passes on Julia 1.12.7 and 1.6.7.This is the ELF counterpart of #69.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JnariwhJ27gVWNZnYbst65