summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/tools/llvm-strings/all-sections.test3
-rw-r--r--llvm/tools/llvm-strings/llvm-strings.cpp6
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-strings/all-sections.test b/llvm/test/tools/llvm-strings/all-sections.test
new file mode 100644
index 00000000000..dcf351913d3
--- /dev/null
+++ b/llvm/test/tools/llvm-strings/all-sections.test
@@ -0,0 +1,3 @@
+RUN: llvm-strings -a %S/Inputs/abcd | FileCheck %s
+RUN: llvm-strings --all %S/Inputs/abcd | FileCheck %s
+CHECK: abcd
diff --git a/llvm/tools/llvm-strings/llvm-strings.cpp b/llvm/tools/llvm-strings/llvm-strings.cpp
index 5053e9b97b7..638d58fce2b 100644
--- a/llvm/tools/llvm-strings/llvm-strings.cpp
+++ b/llvm/tools/llvm-strings/llvm-strings.cpp
@@ -41,6 +41,12 @@ static cl::opt<int>
cl::init(4));
static cl::alias MinLengthShort("n", cl::desc(""), cl::aliasopt(MinLength));
+static cl::opt<bool>
+ AllSections("all",
+ cl::desc("Check all sections, not just the data section"));
+static cl::alias AllSectionsShort("a", cl::desc(""),
+ cl::aliasopt(AllSections));
+
enum radix { none, octal, hexadecimal, decimal };
static cl::opt<radix>
Radix("radix", cl::desc("print the offset within the file"),
OpenPOWER on IntegriCloud