Skip to content

Comments

Add get_rpath() method to ElfContainer#40

Merged
nichmor merged 1 commit intomainfrom
add-get-rpath-method
Jan 16, 2026
Merged

Add get_rpath() method to ElfContainer#40
nichmor merged 1 commit intomainfrom
add-get-rpath-method

Conversation

@nichmor
Copy link
Owner

@nichmor nichmor commented Jan 16, 2026

Summary

  • Add get_rpath() method to ElfContainer that returns RPATH/RUNPATH entries as Vec<String>
  • Enables maturin to use arwen instead of goblin for reading rpath values

Context

This change supports PyO3/maturin#2932 which replaces patchelf with arwen. The PR currently has a get_rpath function using goblin directly with a TODO comment "Unify goblin and object usage."

With this method, maturin can replace:

// Before (goblin):
match goblin::Object::parse(&contents) {
    Ok(goblin::Object::Elf(elf)) => {
        let rpaths = if !elf.runpaths.is_empty() { elf.runpaths } else { elf.rpaths };
        Ok(rpaths.iter().map(|r| r.to_string()).collect())
    }
}

// After (arwen):
let elf = ElfContainer::parse(&contents)?;
Ok(elf.get_rpath())

Test plan

  • cargo check passes

🤖 Generated with Claude Code

Add a method to retrieve RPATH/RUNPATH entries as a list of paths,
enabling maturin to use arwen instead of goblin for reading rpath values.

Related: PyO3/maturin#2932

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@nichmor nichmor merged commit 8f003f3 into main Jan 16, 2026
7 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.

1 participant