X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_strip;h=ea5315a3b12999cd1b63d956f62ffa1b9ca6a9ca;hb=0ace43d32347c4c1a23f8b72ae02e1edd11654e4;hp=4dc69616f971a5678374526e172a577f948a4ba5;hpb=a870aa095247275de6f791ddbcd098fb51cbee47;p=debhelper.git diff --git a/dh_strip b/dh_strip index 4dc6961..ea5315a 100755 --- a/dh_strip +++ b/dh_strip @@ -161,7 +161,14 @@ sub make_debug { return unless get_file_type($file) =~ /not stripped/; my ($base_file)=$file=~/^\Q$tmp\E(.*)/; - my $debug_path=$desttmp."/usr/lib/debug/".$base_file; + my $debug_path; + if (! compat(8) && + `readelf -n $file`=~ /^\s+Build ID: ([0-9a-f]{2})([0-9a-f]+)$/m) { + $debug_path=$desttmp."/usr/lib/debug/.build-id/$1/$2.debug" + } + else { + $debug_path=$desttmp."/usr/lib/debug/".$base_file; + } my $debug_dir=dirname($debug_path); if (! -d $debug_dir) { doit("install", "-d", $debug_dir); @@ -214,7 +221,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { foreach (@shared_libs) { my $debug_path = make_debug($_, $tmp, $debugtmp) if $keep_debug; # Note that all calls to strip on shared libs - # *must* inclde the --strip-unneeded. + # *must* include the --strip-unneeded. doit($strip,"--remove-section=.comment", "--remove-section=.note","--strip-unneeded",$_); attach_debug($_, $debug_path) if defined $debug_path;