[ARM] Report fatal error for wrong ARM entry point

The case is possible with wrong input, so report
an error instead of using llvm_unreachable.

llvm-svn: 233899
This commit is contained in:
Denis Protivensky 2015-04-02 07:03:44 +00:00
parent 949eb3f6a7
commit ff51abcc52
1 changed files with 4 additions and 2 deletions

View File

@ -111,8 +111,10 @@ std::error_code ARMExecutableWriter<ELFT>::setELFHeader() {
if (const auto *ea = dyn_cast<DefinedAtom>(al->_atom)) {
switch (ea->codeModel()) {
case DefinedAtom::codeNA:
if (al->_virtualAddr & 0x3)
llvm_unreachable("Two least bits must be zero for ARM entry point");
if (al->_virtualAddr & 0x3) {
llvm::report_fatal_error(
"Two least bits must be zero for ARM entry point");
}
break;
case DefinedAtom::codeARMThumb:
// Fixup entry point for Thumb code.