diff --git a/llvm/test/tools/llvm-readobj/gnu-sections.test b/llvm/test/tools/llvm-readobj/gnu-sections.test
index 34bcaabf68e1..1b04f0c29992 100644
--- a/llvm/test/tools/llvm-readobj/gnu-sections.test
+++ b/llvm/test/tools/llvm-readobj/gnu-sections.test
@@ -2,6 +2,12 @@ RUN: llvm-readobj -s %p/Inputs/relocs.obj.elf-i386 --elf-output-style=GNU \
RUN: | FileCheck %s -check-prefix ELF32
RUN: llvm-readobj -S %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
RUN: | FileCheck %s -check-prefix ELF64
+RUN: llvm-readobj --wide --sections \
+RUN: %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
+RUN: | FileCheck %s -check-prefix ELF64
+RUN: llvm-readobj -W --sections \
+RUN: %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
+RUN: | FileCheck %s -check-prefix ELF64
ELF32: Section Headers:
ELF32-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp
index 0a76368883a7..3aa795414568 100644
--- a/llvm/tools/llvm-readobj/llvm-readobj.cpp
+++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp
@@ -50,6 +50,13 @@ namespace opts {
cl::desc(""),
cl::ZeroOrMore);
+ // -wide, -W
+ cl::opt WideOutput("wide",
+ cl::desc("Ignored for compatibility with GNU readelf"));
+ cl::alias WideOutputShort("W",
+ cl::desc("Alias for --wide"),
+ cl::aliasopt(WideOutput));
+
// -file-headers, -h
cl::opt FileHeaders("file-headers",
cl::desc("Display file headers "));
@@ -544,6 +551,8 @@ int main(int argc, const char *argv[]) {
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
+ opts::WideOutput.setHiddenFlag(cl::Hidden);
+
cl::ParseCommandLineOptions(argc, argv, "LLVM Object Reader\n");
// Default to stdin if no filename is specified.