@@ -5,7 +5,7 @@
# there.
# Override the user's locale so we are sure we can parse the output of
-# readelf(1) and file(1)
+# file(1)
export LC_ALL=C
main() {
@@ -41,10 +41,7 @@ elf_needs_rpath() {
while read lib; do
[ -e "${hostdir}/usr/lib/${lib}" ] && return 0
- done < <( readelf -d "${file}" \
- |sed -r -e '/^.* \(NEEDED\) .*Shared library: \[(.+)\]$/!d;' \
- -e 's//\1/;' \
- )
+ done < <( patchelf --print-needed "${file}" )
return 1
}
@@ -60,10 +57,7 @@ check_elf_has_rpath() {
dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
[ "${dir}" = "${hostdir}/usr/lib" -o "${dir}" = "\$ORIGIN/../../usr/lib" ] && return 0
done
- done < <( readelf -d "${file}" \
- |sed -r -e '/.* \(R(UN)?PATH\) +Library r(un)?path: \[(.+)\]$/!d' \
- -e 's//\3/;' \
- )
+ done < <( patchelf --print-rpath "${file}" )
return 1
}
"patchelf --print-rpath" returns the rpath without using regex's. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> --- support/scripts/check-host-rpath | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)