Commit 39d114ddc682 ("arm64: add KASAN support") added .weak directives to arch/arm64/lib/mem*.S instead of changing the existing SYM_FUNC_START_PI macros. This can lead to the assembly snippet `.weak memcpy ... .globl memcpy` which will produce a STB_WEAK memcpy with GNU as but STB_GLOBAL memcpy with LLVM's integrated assembler before LLVM 12. LLVM 12 (since https://reviews.llvm.org/D90108) will error on such an overridden symbol binding. Use the appropriate SYM_FUNC_START_WEAK_PI instead.
Unified · Split
| @@ -56,9 +56,8 @@ · 55 unmodified lines | |||
| 56 | stp \reg1, \reg2, [\ptr], \val | 56 | stp \reg1, \reg2, [\ptr], \val |
| 57 | .endm | 57 | .endm |
| 58 | 58 | ||
| 59 | .weak memcpy | ||
| 60 | SYM_FUNC_START_ALIAS(__memcpy) | 59 | SYM_FUNC_START_ALIAS(__memcpy) |
| 61 | SYM_FUNC_START_PI(memcpy) | 60 | SYM_FUNC_START_WEAK_PI(memcpy) |
| 62 | #include "copy_template.S" | 61 | #include "copy_template.S" |
| 63 | ret | 62 | ret |
| 64 | SYM_FUNC_END_PI(memcpy) | 63 | SYM_FUNC_END_PI(memcpy) |
| @@ -45,9 +45,8 @@ C_h .req x12 · 44 unmodified lines | |||
| 45 | D_l .req x13 | 45 | D_l .req x13 |
| 46 | D_h .req x14 | 46 | D_h .req x14 |
| 47 | 47 | ||
| 48 | .weak memmove | ||
| 49 | SYM_FUNC_START_ALIAS(__memmove) | 48 | SYM_FUNC_START_ALIAS(__memmove) |
| 50 | SYM_FUNC_START_PI(memmove) | 49 | SYM_FUNC_START_WEAK_PI(memmove) |
| 51 | cmp dstin, src | 50 | cmp dstin, src |
| 52 | b.lo __memcpy | 51 | b.lo __memcpy |
| 53 | add tmp1, src, count | 52 | add tmp1, src, count |
| @@ -42,9 +42,8 @@ dst .req x8 · 41 unmodified lines | |||
| 42 | tmp3w .req w9 | 42 | tmp3w .req w9 |
| 43 | tmp3 .req x9 | 43 | tmp3 .req x9 |
| 44 | 44 | ||
| 45 | .weak memset | ||
| 46 | SYM_FUNC_START_ALIAS(__memset) | 45 | SYM_FUNC_START_ALIAS(__memset) |
| 47 | SYM_FUNC_START_PI(memset) | 46 | SYM_FUNC_START_WEAK_PI(memset) |
| 48 | mov dst, dstin /* Preserve return value. */ | 47 | mov dst, dstin /* Preserve return value. */ |
| 49 | and A_lw, val, #255 | 48 | and A_lw, val, #255 |
| 50 | orr A_lw, A_lw, A_lw, lsl #8 | 49 | orr A_lw, A_lw, A_lw, lsl #8 |