[llvm] r205456 - Add back an assert that was lost in the ELFObjectFile.h split.
Rafael Espindola
rafael.espindola at gmail.com
Wed Apr 2 13:00:33 PDT 2014
Author: rafael
Date: Wed Apr 2 15:00:33 2014
New Revision: 205456
URL: http://llvm.org/viewvc/llvm-project?rev=205456&view=rev
Log:
Add back an assert that was lost in the ELFObjectFile.h split.
Modified:
llvm/trunk/include/llvm/Object/ELFObjectFile.h
Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=205456&r1=205455&r2=205456&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Wed Apr 2 15:00:33 2014
@@ -625,6 +625,9 @@ ELFObjectFile<ELFT>::getRelocationSymbol
template <class ELFT>
error_code ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
uint64_t &Result) const {
+ assert((EF.getHeader()->e_type == ELF::ET_EXEC ||
+ EF.getHeader()->e_type == ELF::ET_DYN) &&
+ "Only executable and shared objects files have relocation addresses");
Result = getROffset(Rel);
return object_error::success;
}
@@ -632,6 +635,8 @@ error_code ELFObjectFile<ELFT>::getReloc
template <class ELFT>
error_code ELFObjectFile<ELFT>::getRelocationOffset(DataRefImpl Rel,
uint64_t &Result) const {
+ assert(EF.getHeader()->e_type == ELF::ET_REL &&
+ "Only relocatable object files have relocation offsets");
Result = getROffset(Rel);
return object_error::success;
}
More information about the llvm-commits
mailing list