Skip to content

Commit

Permalink
arm64: Adjust mem*.S to use WEAK instead of .weak.
Browse files Browse the repository at this point in the history
Commit 39d114d added .weak directives to
support KASAN on AArch64, however this breaks support for LLVM's
integrated assembler as LLVM switched the .weak directive to produce a
STB_GLOBAL binding rather than STB_WEAK [1].

By utilising the WEAK macro instead, both LLVM and GCC will produce a
STB_WEAK binding.

[1] : https://reviews.llvm.org/D90108

Link: ClangBuiltLinux/linux#1190
Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev>
  • Loading branch information
lazerl0rd committed Dec 7, 2020
1 parent a02acbb commit e1b1da1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions arch/arm64/lib/memcpy.S
Expand Up @@ -68,9 +68,8 @@
stp \ptr, \regB, [\regC], \val
.endm

.weak memcpy
ENTRY(__memcpy)
ENTRY(memcpy)
WEAK(memcpy)
#include "copy_template.S"
ret
ENDPIPROC(memcpy)
Expand Down
3 changes: 1 addition & 2 deletions arch/arm64/lib/memmove.S
Expand Up @@ -57,9 +57,8 @@ C_h .req x12
D_l .req x13
D_h .req x14

.weak memmove
ENTRY(__memmove)
ENTRY(memmove)
WEAK(memmove)
prfm pldl1strm, [src, #L1_CACHE_BYTES]
cmp dstin, src
b.lo __memcpy
Expand Down
3 changes: 1 addition & 2 deletions arch/arm64/lib/memset.S
Expand Up @@ -54,9 +54,8 @@ dst .req x8
tmp3w .req w9
tmp3 .req x9

.weak memset
ENTRY(__memset)
ENTRY(memset)
WEAK(memset)
mov dst, dstin /* Preserve return value. */
and A_lw, val, #255
orr A_lw, A_lw, A_lw, lsl #8
Expand Down

0 comments on commit e1b1da1

Please sign in to comment.