Move to llvm-readobj code that is only used there.

lld might end up using a small part of this, but it will be in a much
refactored form. For now this unblocks avoiding the full section scan in the
ELFFile constructor.

This also has a (very small) error handling improvement.

llvm-svn: 244282
This commit is contained in:
Rafael Espindola
2015-08-06 21:54:37 +00:00
parent 03c9cd0852
commit 8b3b09fdcf
4 changed files with 216 additions and 215 deletions

View File

@@ -191,7 +191,7 @@ namespace opts {
namespace llvm {
void reportError(Twine Msg) {
outs() << Msg << "\n";
outs() << "\nError reading file: " << Msg << ".\n";
outs().flush();
exit(1);
}
@@ -200,7 +200,7 @@ void error(std::error_code EC) {
if (!EC)
return;
reportError(Twine("\nError reading file: ") + EC.message() + ".");
reportError(EC.message());
}
bool relocAddressLess(RelocationRef a, RelocationRef b) {