separateDebugInfo: Create symlinks matching original binaries

For instance, a binary like libfoo.so will cause a symlink
lib/debug/libfoo.so.debug -> .build-id/<build-ID>.debug to be
created. This is primarily useful for use with eu-addr2line, if you
know the name of a binary and the relative address, but not the build
ID.
This commit is contained in:
Eelco Dolstra 2016-01-15 16:12:05 +01:00
parent 5b20713041
commit 2fcee55e5f

View File

@ -32,6 +32,9 @@ _separateDebugInfo() {
mkdir -p "$dst/${id:0:2}"
objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" --compress-debug-sections
strip --strip-debug "$i"
# Also a create a symlink <original-name>.debug.
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
done
}