summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorDenis Protivensky <dprotivensky@accesssoftek.com>2015-05-07 13:41:44 +0000
committerDenis Protivensky <dprotivensky@accesssoftek.com>2015-05-07 13:41:44 +0000
commitaaeba9ebb92076986bc444f76fd9313d86164626 (patch)
tree1ba121a99945416b466f805de71c38c6ef7a15a8 /lld
parentf84d76fbf2310ef44251853c2a2d007a51bf4a2a (diff)
downloadbcm5719-llvm-aaeba9ebb92076986bc444f76fd9313d86164626.tar.gz
bcm5719-llvm-aaeba9ebb92076986bc444f76fd9313d86164626.zip
[ARM] llvm_unreachable => make_*_reloc_error in group relocs
llvm-svn: 236726
Diffstat (limited to 'lld')
-rw-r--r--lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
index 089e6cd6f21..b0f28426540 100644
--- a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
+++ b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
@@ -112,6 +112,11 @@ static Reference::Addend readAddend(const uint8_t *location,
}
}
+static inline std::error_code make_unsupported_range_group_reloc_error() {
+ return make_dynamic_error_code(
+ "Negative offsets for group relocations are not implemented");
+}
+
static inline std::error_code applyArmReloc(uint8_t *location, uint32_t result,
uint32_t mask = 0xFFFFFFFF) {
assert(!(result & ~mask));
@@ -475,10 +480,8 @@ static std::error_code relocR_ARM_ALU_PC_GN_NC(uint8_t *location,
static std::error_code relocR_ARM_ALU_PC_G0_NC(uint8_t *location, uint64_t P,
uint64_t S, int64_t A) {
int32_t result = (int32_t)(S + A - P);
-
if (result < 0)
- llvm_unreachable(
- "Negative offsets for group relocations has not been implemented");
+ return make_unsupported_range_group_reloc_error();
DEBUG(llvm::dbgs() << "\t\tHandle " << LLVM_FUNCTION_NAME << " -";
llvm::dbgs() << " S: 0x" << Twine::utohexstr(S);
@@ -494,10 +497,8 @@ static std::error_code relocR_ARM_ALU_PC_G0_NC(uint8_t *location, uint64_t P,
static std::error_code relocR_ARM_ALU_PC_G1_NC(uint8_t *location, uint64_t P,
uint64_t S, int64_t A) {
int32_t result = (int32_t)(S + A - P);
-
if (result < 0)
- llvm_unreachable(
- "Negative offsets for group relocations has not been implemented");
+ return make_unsupported_range_group_reloc_error();
DEBUG(llvm::dbgs() << "\t\tHandle " << LLVM_FUNCTION_NAME << " -";
llvm::dbgs() << " S: 0x" << Twine::utohexstr(S);
@@ -513,10 +514,8 @@ static std::error_code relocR_ARM_ALU_PC_G1_NC(uint8_t *location, uint64_t P,
static std::error_code relocR_ARM_LDR_PC_G2(uint8_t *location, uint64_t P,
uint64_t S, int64_t A) {
int32_t result = (int32_t)(S + A - P);
-
if (result < 0)
- llvm_unreachable(
- "Negative offsets for group relocations has not been implemented");
+ return make_unsupported_range_group_reloc_error();
DEBUG(llvm::dbgs() << "\t\tHandle " << LLVM_FUNCTION_NAME << " -";
llvm::dbgs() << " S: 0x" << Twine::utohexstr(S);
OpenPOWER on IntegriCloud