This will create new-style buildid symlinks for the splitted debuginfo and also a symlink to the binary that belongs to the debuginfo. Requires debugedit from rpm 5. Old versions of debugedit ignore all unkown command line arguments, so this is a no-op for them. Information: http://fedoraproject.org/wiki/Releases/FeatureBuildId New debugedit tarball: http://dev.gentoo.org/~swegener/distfiles/debugedit-5.0.0.tar.bz2 New debugedit ebuild: http://svn.stealer.net/swegener-overlay-testing/dev-util/debugedit/ Index: trunk/bin/prepstrip =================================================================== --- trunk/bin/prepstrip (revision 11499) +++ trunk/bin/prepstrip (working copy) @@ -56,12 +56,23 @@ # dont save debug info twice [[ ${x} == *".debug" ]] && return 0 + # this will recompute the build-id, but for now that's ok + local buildid="$( type -P debugedit >/dev/null && debugedit -i "${x}" )" + mkdir -p $(dirname "${y}") ${OBJCOPY} --only-keep-debug "${x}" "${y}" ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}" [[ -g ${x} ]] && chmod go-r "${y}" [[ -u ${x} ]] && chmod go-r "${y}" chmod a-x,o-w "${y}" + + if [[ -n ${buildid} ]] ; then + local buildid_dir="${D}usr/lib/debug/.build-id/${buildid:0:2}" + local buildid_file="${buildid_dir}/${buildid:2}" + mkdir -p "${buildid_dir}" + ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug" + ln -s "/${x:${#D}}" "${buildid_file}" + fi } # The existance of the section .symtab tells us that a binary is stripped.