summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-11-05 23:33:39 +0000
committerCommit Bot <commit-bot@chromium.org>2021-12-11 01:24:02 +0000
commit9d96e18a05a09a8e6b7c8de64f0f4ce3d83a859e (patch)
treee089ab87b1b001240222f20e03f86e280117064f
parent92c39fcf0f6f62722ec6fa8440de689055e2d398 (diff)
downloadchrome-ec-9d96e18a05a09a8e6b7c8de64f0f4ce3d83a859e.tar.gz
core/cortex-m0: Fix div.S compilation with clang
Add an additional label at the same address as __aeavi_uidivmod to work around a linker crash crash when using clang: ld.lld: error: core/cortex-m0/div.S:51:(.text+0x10): internal linker error: cannot read addend for relocation R_ARM_THM_JUMP8 BRANCH=none BUG=b:172020503, b:205351146 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I5a7f682377311e881ac2bcdb85b854127f5907ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3265867 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--third_party/libaeabi-cortexm0/core/cortex-m0/div.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/libaeabi-cortexm0/core/cortex-m0/div.S b/third_party/libaeabi-cortexm0/core/cortex-m0/div.S
index 06dc7afacb..b3f61df632 100644
--- a/third_party/libaeabi-cortexm0/core/cortex-m0/div.S
+++ b/third_party/libaeabi-cortexm0/core/cortex-m0/div.S
@@ -49,7 +49,7 @@ __aeabi_idiv:
L_num_pos:
cmp r1, #0
- bge __aeabi_uidivmod
+ bge Luidivmod
rsbs r1, r1, #0 @ den = -den
@@ -94,7 +94,7 @@ L_neg_both:
L_num_pos_bis:
cmp r1, #0
- bge __aeabi_uidivmod
+ bge Luidivmod
rsbs r1, r1, #0 @ den = -den
push {lr}
@@ -125,6 +125,7 @@ __aeabi_uidiv:
__aeabi_uidivmod:
+Luidivmod:
cmp r1, #0
bne L_no_div0
b __aeabi_idiv0