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
56 stp \reg1, \reg2, [\ptr], \val56 stp \reg1, \reg2, [\ptr], \val
57 .endm57 .endm
58 58
59 .weak memcpy
60SYM_FUNC_START_ALIAS(__memcpy)59SYM_FUNC_START_ALIAS(__memcpy)
61SYM_FUNC_START_PI(memcpy)60SYM_FUNC_START_WEAK_PI(memcpy)
62#include "copy_template.S"61#include "copy_template.S"
63 ret62 ret
64SYM_FUNC_END_PI(memcpy)63SYM_FUNC_END_PI(memcpy)
arch/arm64/lib/memmove.S+1−2
@@ -45,9 +45,8 @@ C_h .req x12 · 44 unmodified lines
45D_l .req x1345D_l .req x13
46D_h .req x1446D_h .req x14
47 47
48 .weak memmove
49SYM_FUNC_START_ALIAS(__memmove)48SYM_FUNC_START_ALIAS(__memmove)
50SYM_FUNC_START_PI(memmove)49SYM_FUNC_START_WEAK_PI(memmove)
51 cmp dstin, src50 cmp dstin, src
52 b.lo __memcpy51 b.lo __memcpy
53 add tmp1, src, count52 add tmp1, src, count
arch/arm64/lib/memset.S+1−2
@@ -42,9 +42,8 @@ dst .req x8 · 41 unmodified lines
42tmp3w .req w942tmp3w .req w9
43tmp3 .req x943tmp3 .req x9
44 44
45 .weak memset
46SYM_FUNC_START_ALIAS(__memset)45SYM_FUNC_START_ALIAS(__memset)
47SYM_FUNC_START_PI(memset)46SYM_FUNC_START_WEAK_PI(memset)
48 mov dst, dstin /* Preserve return value. */47 mov dst, dstin /* Preserve return value. */
49 and A_lw, val, #25548 and A_lw, val, #255
50 orr A_lw, A_lw, A_lw, lsl #849 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