summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/cortex-m0/ldivmod.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/cortex-m0/ldivmod.S b/core/cortex-m0/ldivmod.S
index 48ebdfcc65..853d85b0d2 100644
--- a/core/cortex-m0/ldivmod.S
+++ b/core/cortex-m0/ldivmod.S
@@ -73,8 +73,12 @@ L_neg_both:
L_num_pos:
cmp r3, #0
- bge __aeabi_uldivmod
+ blt L_den_neg
+ push {r4, lr}
+ bl __aeabi_uldivmod @ offset too big for b / bge
+ pop {r4, pc}
+L_den_neg:
push {r4, lr}
movs r4, #0 @ den = -den
rsbs r2, r2, #0