From f1b47067ccf6e258be88ee3106a6d49f4663e8cd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 10 Sep 2008 20:46:05 +0000 Subject: New debugedit support for FEATURES=splitdebug, by Sven Wegener: 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 svn path=/main/trunk/; revision=11500 --- bin/prepstrip | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin/prepstrip') diff --git a/bin/prepstrip b/bin/prepstrip index bc2fa79cf..33bdb2209 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -56,12 +56,23 @@ save_elf_debug() { # 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. -- cgit v1.2.3-1-g7c22