History

arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S

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.

Fangrui Song committed 6 years ago

Commit ec9d7801 parent ce3d31a3 files · +3 −6Browse files

Unified · Split

3 files
  1. arch/arm64/lib/memcpy.S +1 −2
  2. arch/arm64/lib/memmove.S +1 −2
  3. arch/arm64/lib/memset.S +1 −2
arch/arm64/lib/memcpy.S+1−2
@@ -56,9 +56,8 @@ · 55 unmodified lines
5656 stp \reg1, \reg2, [\ptr], \val
5757 .endm
5858
59− .weak memcpy
6059 SYM_FUNC_START_ALIAS(__memcpy)
61−SYM_FUNC_START_PI(memcpy)
60+SYM_FUNC_START_WEAK_PI(memcpy)
6261 #include "copy_template.S"
6362 ret
6463 SYM_FUNC_END_PI(memcpy)
arch/arm64/lib/memmove.S+1−2
@@ -45,9 +45,8 @@ C_h .req x12 · 44 unmodified lines
4545 D_l .req x13
4646 D_h .req x14
4747
48− .weak memmove
4948 SYM_FUNC_START_ALIAS(__memmove)
50−SYM_FUNC_START_PI(memmove)
49+SYM_FUNC_START_WEAK_PI(memmove)
5150 cmp dstin, src
5251 b.lo __memcpy
5352 add tmp1, src, count
arch/arm64/lib/memset.S+1−2
@@ -42,9 +42,8 @@ dst .req x8 · 41 unmodified lines
4242 tmp3w .req w9
4343 tmp3 .req x9
4444
45− .weak memset
4645 SYM_FUNC_START_ALIAS(__memset)
47−SYM_FUNC_START_PI(memset)
46+SYM_FUNC_START_WEAK_PI(memset)
4847 mov dst, dstin /* Preserve return value. */
4948 and A_lw, val, #255
5049 orr A_lw, A_lw, A_lw, lsl #8

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t