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

Improve type stability of rpaths(RPath(oh::ELFHandle)) #43

Merged
merged 1 commit into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/ELF/ELFDynamicLink.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Stores the RPath entries from an ELF object
"""
struct ELFRPath{H <: ELFHandle} <: RPath{H}
section_ref::SectionRef{H}
rpath::Vector
rpath::Vector{<:AbstractString}
end

"""
Expand All @@ -106,13 +106,18 @@ function RPath(oh::ELFHandle)
des = ELFDynEntries(oh, [DT_RPATH, DT_RUNPATH])

# Lookup each and every one of those strings, split them out into paths
colon_paths = [strtab_lookup(d) for d in des]
paths = vcat([split(p, ":") for p in colon_paths]...)
colon_paths = String[strtab_lookup(d) for d in des]
paths = AbstractString[]
for colon_path in colon_paths
for component in split(colon_path, ':')
push!(paths, component)
end
end

# Return our RPath object
return ELFRPath(dyn_section, paths)
end

Section(rpath::ELFRPath) = rpath.section_ref
handle(rpath::ELFRPath) = handle(Section(rpath))
rpaths(rpath::ELFRPath) = rpath.rpath
rpaths(rpath::ELFRPath) = rpath.rpath
Loading