aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2019-10-17 20:51:00 +0000
committerJordan Rupprecht <rupprecht@google.com>2019-10-17 20:51:00 +0000
commitedeebad7715774b8481103733dc5d52dac43bdf3 (patch)
treec84c0c304f7142e3ecef79ccd5120179a6dc1e60 /llvm/tools/llvm-objcopy/llvm-objcopy.cpp
parent9c5d76ff4d15e2cabf976911bd150302ae5fdeea (diff)
downloadllvm-edeebad7715774b8481103733dc5d52dac43bdf3.zip
llvm-edeebad7715774b8481103733dc5d52dac43bdf3.tar.gz
llvm-edeebad7715774b8481103733dc5d52dac43bdf3.tar.bz2
[llvm-objcopy] Add support for shell wildcards
Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags). The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag. Use an updated GlobPattern in libSupport to handle these patterns. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway). Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap Reviewed By: MaskRay Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66613 llvm-svn: 375169
Diffstat (limited to 'llvm/tools/llvm-objcopy/llvm-objcopy.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/llvm-objcopy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
index db6d751..a68210f 100644
--- a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
+++ b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
@@ -335,7 +335,7 @@ int main(int argc, char **argv) {
Expected<DriverConfig> DriverConfig =
IsStrip ? parseStripOptions(Args, reportWarning)
- : parseObjcopyOptions(Args);
+ : parseObjcopyOptions(Args, reportWarning);
if (!DriverConfig) {
logAllUnhandledErrors(DriverConfig.takeError(),
WithColor::error(errs(), ToolName));