Add back an assert that was lost in the ELFObjectFile.h split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-04-02 20:00:33 +00:00
parent adb852ddf3
commit 04194e05db

View File

@ -625,6 +625,9 @@ ELFObjectFile<ELFT>::getRelocationSymbol(DataRefImpl Rel) const {
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>::getRelocationAddress(DataRefImpl Rel,
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;
}