mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
[Object] Split the ELF interface into 3 parts.
* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//===- llvm-readobj.cpp - Dump contents of an Object File -----------------===//
|
||||
//===- llvm-readobj.cpp - Dump contents of an Object File -----------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@@ -130,12 +130,15 @@ namespace opts {
|
||||
cl::desc("Expand each shown relocation to multiple lines"));
|
||||
} // namespace opts
|
||||
|
||||
static int ReturnValue = EXIT_SUCCESS;
|
||||
|
||||
namespace llvm {
|
||||
|
||||
bool error(error_code EC) {
|
||||
if (!EC)
|
||||
return false;
|
||||
|
||||
ReturnValue = EXIT_FAILURE;
|
||||
outs() << "\nError reading file: " << EC.message() << ".\n";
|
||||
outs().flush();
|
||||
return true;
|
||||
@@ -157,6 +160,7 @@ static void reportError(StringRef Input, error_code EC) {
|
||||
|
||||
errs() << Input << ": " << EC.message() << "\n";
|
||||
errs().flush();
|
||||
ReturnValue = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
static void reportError(StringRef Input, StringRef Message) {
|
||||
@@ -164,6 +168,7 @@ static void reportError(StringRef Input, StringRef Message) {
|
||||
Input = "<stdin>";
|
||||
|
||||
errs() << Input << ": " << Message << "\n";
|
||||
ReturnValue = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/// @brief Creates an format-specific object file dumper.
|
||||
@@ -289,5 +294,5 @@ int main(int argc, const char *argv[]) {
|
||||
std::for_each(opts::InputFilenames.begin(), opts::InputFilenames.end(),
|
||||
dumpInput);
|
||||
|
||||
return 0;
|
||||
return ReturnValue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user