Skip to content

Commit 909d215

Browse files
rakonscarlescufi
authored andcommitted
mcux: mcux-sdk: Fix labels in inline assembly
This commit fixes labels in inline assembly to use unique identifiers for internal labels. This fix is required to be able to use LTO. Signed-off-by: Radoslaw Koppel <[email protected]>
1 parent ae43870 commit 909d215

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

mcux/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ Patch List:
9090
- mcux-sdk\manifests
9191
- mcux-sdk\middleware\issdk\docs
9292
- mcux-sdk\docs
93+
26. mcux: mcux-sdk: Fix "loop" labels in inline assembly to use unique identifiers.

mcux/mcux-sdk/components/css_pkc/src/comps/mcuxCsslMemory/inc/impl/mcuxCsslMemory_Compare_asm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ do{ \
2929
uint8_t dat_lhs, dat_rhs; \
3030
__asm volatile ( \
3131
"EOR %[_retval], %[_result], %[_notValid]\n" /* retval should now be 0xFFFFFFFF */\
32-
"loop:\n" /* Comparison; in case of equality retval should remain 0xFFFFFFFF throughout the loop. */\
32+
"loop%=:\n" /* Comparison; in case of equality retval should remain 0xFFFFFFFF throughout the loop. */\
3333
"LDRB %[_dat_lhs], [%[_cur_lhs]], #+1\n" \
3434
"LDRB %[_dat_rhs], [%[_cur_rhs]], #+1\n" \
3535
"EORS %[_dat_lhs], %[_dat_lhs], %[_dat_rhs]\n" \
3636
"BICS %[_retval], %[_retval], %[_dat_lhs]\n" \
3737
"SUBS %[_cnt], %[_cnt], #+1\n" \
3838
"MVN %[_dat_rhs], %[_dat_lhs]\n" \
3939
"AND %[_retval], %[_retval], %[_dat_rhs]\n" \
40-
"BNE loop\n" \
40+
"BNE loop%=\n" \
4141
: [_retval] "=r" (retval_), \
4242
[_cur_lhs] "+r" (cur_lhs_), \
4343
[_cur_rhs] "+r" (cur_rhs_), \

mcux/mcux-sdk/drivers/common/fsl_common_arm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ static void DelayLoop(uint32_t count)
159159
{
160160
__ASM volatile(" MOV X0, %0" : : "r"(count));
161161
__ASM volatile(
162-
"loop: \n"
162+
"loop%=: \n"
163163
" SUB X0, X0, #1 \n"
164164
" CMP X0, #0 \n"
165165

166-
" BNE loop \n"
166+
" BNE loop%= \n"
167167
:
168168
:
169169
: "r0");
@@ -176,15 +176,15 @@ static void DelayLoop(uint32_t count)
176176
{
177177
__ASM volatile(" MOV R0, %0" : : "r"(count));
178178
__ASM volatile(
179-
"loop: \n"
179+
"loop%=: \n"
180180
#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
181181
" SUB R0, R0, #1 \n"
182182
#else
183183
" SUBS R0, R0, #1 \n"
184184
#endif
185185
" CMP R0, #0 \n"
186186

187-
" BNE loop \n"
187+
" BNE loop%= \n"
188188
:
189189
:
190190
: "r0");

0 commit comments

Comments
 (0)