diff options
| author | George Rimar <grimar@accesssoftek.com> | 2019-05-07 13:14:18 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2019-05-07 13:14:18 +0000 |
| commit | 5c922f698847a7059e9015dcf73721af3be852a3 (patch) | |
| tree | 179e98140e648ddea06b05adf55f41afe460ef01 /llvm/include | |
| parent | 7399ad31931d1e63ba81937f4128a23add3d3511 (diff) | |
| download | bcm5719-llvm-5c922f698847a7059e9015dcf73721af3be852a3.tar.gz bcm5719-llvm-5c922f698847a7059e9015dcf73721af3be852a3.zip | |
[llvm-objdump] - Print relocation record in a GNU format.
This fixes the https://bugs.llvm.org/show_bug.cgi?id=41355.
Previously with -r we printed relocation section name instead of the target section name.
It was like this: "RELOCATION RECORDS FOR [.rel.text]"
Now it is: "RELOCATION RECORDS FOR [.text]"
Also when relocation target section has more than one relocation section,
we did not combine the output. Now we do.
Differential revision: https://reviews.llvm.org/D61312
llvm-svn: 360143
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Object/ObjectFile.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/llvm/include/llvm/Object/ObjectFile.h b/llvm/include/llvm/Object/ObjectFile.h index de4867c2cd5..3d293c6969e 100644 --- a/llvm/include/llvm/Object/ObjectFile.h +++ b/llvm/include/llvm/Object/ObjectFile.h @@ -13,6 +13,7 @@ #ifndef LLVM_OBJECT_OBJECTFILE_H #define LLVM_OBJECT_OBJECTFILE_H +#include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" #include "llvm/ADT/iterator_range.h" @@ -421,14 +422,16 @@ inline SectionRef::SectionRef(DataRefImpl SectionP, , OwningObject(Owner) {} inline bool SectionRef::operator==(const SectionRef &Other) const { - return SectionPimpl == Other.SectionPimpl; + return OwningObject == Other.OwningObject && + SectionPimpl == Other.SectionPimpl; } inline bool SectionRef::operator!=(const SectionRef &Other) const { - return SectionPimpl != Other.SectionPimpl; + return !(*this == Other); } inline bool SectionRef::operator<(const SectionRef &Other) const { + assert(OwningObject == Other.OwningObject); return SectionPimpl < Other.SectionPimpl; } @@ -560,6 +563,25 @@ inline const ObjectFile *RelocationRef::getObject() const { } // end namespace object +template <> struct DenseMapInfo<object::SectionRef> { + static bool isEqual(const object::SectionRef &A, + const object::SectionRef &B) { + return A == B; + } + static object::SectionRef getEmptyKey() { + return object::SectionRef({}, nullptr); + } + static object::SectionRef getTombstoneKey() { + object::DataRefImpl TS; + TS.p = (uintptr_t)-1; + return object::SectionRef(TS, nullptr); + } + static unsigned getHashValue(const object::SectionRef &Sec) { + object::DataRefImpl Raw = Sec.getRawDataRefImpl(); + return hash_combine(Raw.p, Raw.d.a, Raw.d.b); + } +}; + } // end namespace llvm #endif // LLVM_OBJECT_OBJECTFILE_H |

