prepstrip: fix readelf Build ID for bug #460510
authorAlphat-PC <AlphatPC@gmail.com>
Thu, 14 Mar 2013 03:23:58 +0000 (20:23 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Mar 2013 03:23:58 +0000 (20:23 -0700)
bin/ebuild-helpers/prepstrip

index fb20777e886af12ccb2942254c2599e4ec6b6d1f..d791a113be1cd1a5671150afcb2b80883535e994 100755 (executable)
@@ -159,8 +159,7 @@ save_elf_debug() {
        # if we don't already have build-id from debugedit, look it up
        if [[ -z ${buildid} ]] ; then
                # convert the readelf output to something useful
-               buildid=$(${READELF} -x .note.gnu.build-id "${x}" 2>/dev/null \
-                       | awk '$NF ~ /GNU/ { getline; printf $2$3$4$5; getline; print $2 }')
+               buildid=$(${READELF} -n "${x}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }')
        fi
        if [[ -n ${buildid} ]] ; then
                local buildid_dir="${ED}usr/lib/debug/.build-id/${buildid:0:2}"