lib.req: return early if there is no dynamic section, to stop ldd failures with klibc executables

(before this commit)
$ ./scripts/lib.req.in /lib/mkinitrd/udev/lib/udev/usb_id
/lib/klibc-LqkyBjjvuUwwxYg5B9IteGNsWsI.so
ldd: ERROR: /lib/mkinitrd/udev/lib/udev/usb_id: trace failed
$

(after this commit)
$ ./scripts/lib.req.in /lib/mkinitrd/udev/lib/udev/usb_id
/lib/klibc-LqkyBjjvuUwwxYg5B9IteGNsWsI.so
$
This commit is contained in:
Alexey Tourbin 2008-02-19 00:29:32 +03:00
parent e1bb17d070
commit 17b1c6b296

View File

@ -57,6 +57,9 @@ FindLibReqs()
echo 'rtld(GNU_HASH)'
fi
# That could be "statically linked (uses shared libs)".
printf '%s\n' "$dump" |grep -qs '^Dynamic Section:$' || return 0
suffix="$(printf '%s\n' "$dump" |sed -ne 's/^.*file format \(elf64\).*$/(64bit)/p')"
[ -z "$suffix" ] && braces= || braces='()'