The :program:`llvm-readelf` tool displays low-level format-specific information
about one or more object files.
-If ``input`` is "``-``" or omitted, :program:`llvm-readelf` reads from standard
+If ``input`` is "``-``", :program:`llvm-readelf` reads from standard
input. Otherwise, it will read from the specified ``filenames``.
OPTIONS
The :program:`llvm-readobj` tool displays low-level format-specific information
about one or more object files.
-If ``input`` is "``-``" or omitted, :program:`llvm-readobj` reads from standard
+If ``input`` is "``-``", :program:`llvm-readobj` reads from standard
input. Otherwise, it will read from the specified ``filenames``.
DIFFERENCES TO LLVM-READELF
Changes to the LLVM tools
---------------------------------
-During this release ...
+* llvm-readobj and llvm-readelf behavior has changed to report an error when
+ executed with no input files instead of reading an input from stdin.
+ Reading from stdin can still be achieved by specifying `-` as an input file.
Changes to LLDB
---------------------------------
ENOENT: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}.blah': {{[Nn]}}o such file or directory
+# Test case with no input file.
+RUN: not llvm-readobj 2>&1 | FileCheck %s --check-prefix=NO-FILE
+RUN: not llvm-readelf 2>&1 | FileCheck %s --check-prefix=NO-FILE
+NO-FILE: error: no input files specified
+
# Test case where input file is too small to be a recognised object file.
RUN: touch %t.empty
RUN: not llvm-readobj %t.empty 2>&1 | FileCheck --check-prefix=EMPTY %s
cl::ParseCommandLineOptions(argc, argv, "LLVM Object Reader\n");
+ // Default to print error if no filename is specified.
+ if (opts::InputFilenames.empty()) {
+ error("no input files specified");
+ }
+
if (opts::All) {
opts::FileHeaders = true;
opts::ProgramHeaders = true;
opts::SectionHeaders = true;
}
- // Default to stdin if no filename is specified.
- if (opts::InputFilenames.empty())
- opts::InputFilenames.push_back("-");
-
ScopedPrinter Writer(fouts());
for (const std::string &I : opts::InputFilenames)
dumpInput(I, Writer);