diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-17 19:09:37 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-17 19:09:37 +0000 |
| commit | c66d761b97ff9665399584a82e000ef1da3c145e (patch) | |
| tree | 196d430d2d0fa506b050cff3c5d676db270935c4 /llvm/lib/Object | |
| parent | 639557ae867549b98463ccd1eb3f62273a538be1 (diff) | |
| download | bcm5719-llvm-c66d761b97ff9665399584a82e000ef1da3c145e.tar.gz bcm5719-llvm-c66d761b97ff9665399584a82e000ef1da3c145e.zip | |
llvm-objdump: don't print relocations in non-relocatable files.
This matches the behavior of GNU objdump.
llvm-svn: 215844
Diffstat (limited to 'llvm/lib/Object')
| -rw-r--r-- | llvm/lib/Object/COFFObjectFile.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 29ea0a1a79c..717f019509b 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -979,6 +979,10 @@ COFFObjectFile::getRelocationValueString(DataRefImpl Rel, return object_error::success; } +bool COFFObjectFile::isRelocatableObject() const { + return !DataDirectory; +} + bool ImportDirectoryEntryRef:: operator==(const ImportDirectoryEntryRef &Other) const { return ImportTable == Other.ImportTable && Index == Other.Index; diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 8e19eb5631d..afc729f9f82 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -1688,6 +1688,10 @@ void MachOObjectFile::ReadULEB128s(uint64_t Index, } } +bool MachOObjectFile::isRelocatableObject() const { + return getHeader().filetype == MachO::MH_OBJECT; +} + ErrorOr<std::unique_ptr<MachOObjectFile>> ObjectFile::createMachOObjectFile(std::unique_ptr<MemoryBuffer> &Buffer) { StringRef Magic = Buffer->getBuffer().slice(0, 4); |

