diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-07-01 01:30:58 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-07-01 21:52:24 +0200 |
commit | 8ad503a7866066162828796c66489070d661dc44 (patch) | |
tree | f0d31bf3ba69ee27a4215775d1358102b1a6c580 /functions | |
parent | 549af8c1b9a72cacf8cda41f8dd4b76983930945 (diff) | |
download | mkinitcpio-8ad503a7866066162828796c66489070d661dc44.tar.gz mkinitcpio-8ad503a7866066162828796c66489070d661dc44.tar.xz |
avoid touching the linker directly
Much to my chagrin, we're going back to using ldd directly, as it's
otherwise too difficult to account for odd setups, such as idiots
wanting to create multilib initramfs images, or more commonly -- a 64
bit kernel on a 32 bit userland. Fortunately, we don't suffer too large
a regression in speed compared to the previous implementation.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -204,10 +204,6 @@ add_module() { esac } -_ldd() { - LD_TRACE_LOADED_OBJECTS=1 "$LD_SO" "$@" -} - _add_file() { # add a file to $BUILDROOT # $1: pathname on initcpio @@ -264,10 +260,10 @@ add_binary() { # always add the binary itself _add_file "${dest#$BASEDIR}" "$binary" "$mode" - $LD_SO --verify "$binary" &>/dev/null || return # not a binary! + lddout=$(ldd "$binary" 2>/dev/null) || return 1 # not a binary! # resolve sodeps - regex='^[[:space:]]*[^/].+ => (.*) \(.*\)' + regex='(/.+) \(0x[a-fA-F0-9]+\)' while read line; do [[ "$line" =~ $regex ]] && sodep=${BASH_REMATCH[1]} || continue @@ -282,7 +278,7 @@ add_binary() { _add_file "${resolved#$BASEDIR}" "$resolved" 755 fi fi - done < <(_ldd "$binary") + done <<< "$lddout" return 0 } |