[llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major as strip
authorFangrui Song <maskray@google.com>
Sun, 22 Mar 2020 06:39:01 +0000 (23:39 -0700)
committerFangrui Song <maskray@google.com>
Mon, 23 Mar 2020 20:49:26 +0000 (13:49 -0700)
commitf2f96eb605bc770e4da400dbcc7a6d2526ec1fd4
tree416fa715c5ccc351a279703cc2db7a10f2c2d35d
parenta650d555fc218891d55bfcf79ce8832c404d4dc3
[llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major as strip

Debian and some other distributions install llvm-strip as llvm-strip-$major (e.g. `/usr/bin/llvm-strip-9`)

D54193 made it work with llvm-strip-$major but did not add a test.
The behavior was regressed by D69146.

Fixes https://github.com/ClangBuiltLinux/linux/issues/940

Reviewed By: alexshap

Differential Revision: https://reviews.llvm.org/D76562
llvm/test/tools/llvm-objcopy/tool-name.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/llvm-objcopy.cpp