mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-13 23:00:33 +00:00
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:
parent
adb852ddf3
commit
04194e05db
@ -625,6 +625,9 @@ ELFObjectFile<ELFT>::getRelocationSymbol(DataRefImpl Rel) const {
|
|||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
error_code ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
|
error_code ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
|
||||||
uint64_t &Result) const {
|
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);
|
Result = getROffset(Rel);
|
||||||
return object_error::success;
|
return object_error::success;
|
||||||
}
|
}
|
||||||
@ -632,6 +635,8 @@ error_code ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
|
|||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
error_code ELFObjectFile<ELFT>::getRelocationOffset(DataRefImpl Rel,
|
error_code ELFObjectFile<ELFT>::getRelocationOffset(DataRefImpl Rel,
|
||||||
uint64_t &Result) const {
|
uint64_t &Result) const {
|
||||||
|
assert(EF.getHeader()->e_type == ELF::ET_REL &&
|
||||||
|
"Only relocatable object files have relocation offsets");
|
||||||
Result = getROffset(Rel);
|
Result = getROffset(Rel);
|
||||||
return object_error::success;
|
return object_error::success;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user