summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-09-10 20:46:05 +0000
committerZac Medico <zmedico@gentoo.org>2008-09-10 20:46:05 +0000
commitf1b47067ccf6e258be88ee3106a6d49f4663e8cd (patch)
treeb4e773d7e64072eb567cb2c827b05b62955e092f
parent7636a47fc235c48f0ea8752b078f987e79ec43e6 (diff)
downloadportage-f1b47067ccf6e258be88ee3106a6d49f4663e8cd.tar.gz
portage-f1b47067ccf6e258be88ee3106a6d49f4663e8cd.tar.bz2
portage-f1b47067ccf6e258be88ee3106a6d49f4663e8cd.zip
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
-rwxr-xr-xbin/prepstrip11
1 files changed, 11 insertions, 0 deletions
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.