Make copy_required_libs() more robust

On some systems ldd gives a slightly different output for VDSOs. It doesn't
contain a '=>'. E.g.:
   linux-vdso.so.1 (0x00007fff2f4a6000)
instead of:
   linux-vdso.so.1 => (0x00007fff2f4a6000)
This patch simply skips all entries in the ldd output which don't expand to a
path name to workaround that.

Change-Id: Ie37637890b775b36bb31af4e586e61131bd80fa8
This commit is contained in:
Ralf Haferkamp 2014-01-22 17:50:30 +01:00
parent f8081bbd83
commit 9dcd13d45c
1 changed files with 3 additions and 1 deletions

View File

@ -112,12 +112,14 @@ function copy_required_libs() {
# /lib64/ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 (0x00007facff857000)
# 4. name to empty (vdso)
# linux-vdso.so.1 => (0x00007fff0c5ff000)
# or, in some setups:
# linux-vdso.so.1 (0x00007fff0c5ff000)
for i in `echo "$ldd_out" | sed -e 's/^\t*//'`; do
local ref=$( echo "$i" | awk -F '[ ]' '{print $1}')
local real=$( echo "$i" | awk -F '[ ]' '$2 == "=>" {print $3}
$2 != "=>" {print $1}')
if [ -z "$real" ]; then
if [ -z "$real" ] || [[ "$real" != /* ]]; then
continue
fi
if [ "$ref" = "${ref#/}" ]; then