提交 4c885136 编写于 作者: F Fangrui Song 提交者: Zheng Zengkai

ARM: 9022/1: Change arch/arm/lib/mem*.S to use WEAK instead of .weak

mainline inclusion
from mainline-5.11-rc1
commit 735e8d93
category: feature
feature: ARM KASAN support
bugzilla: 46872
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=735e8d93dc2b107f7891a9c2b1c4cfbea1fcbbbc

-------------------------------------------------
Commit d6d51a96 ("ARM: 9014/2: Replace string mem* functions for
KASan") add .weak directives to memcpy/memmove/memset to avoid collision
with KASAN interceptors.

This does not work with LLVM's integrated assembler (the assembly snippet
`.weak memcpy ... .globl memcpy` produces a STB_GLOBAL memcpy while GNU as
produces a STB_WEAK memcpy). LLVM 12 (since https://reviews.llvm.org/D90108)
will error on such an overridden symbol binding.

Use the appropriate WEAK macro instead.

Link: https://github.com/ClangBuiltLinux/linux/issues/1190Reviewed-by: NJing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 be09ffdc
......@@ -58,10 +58,9 @@
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
.weak memcpy
ENTRY(__memcpy)
ENTRY(mmiocpy)
ENTRY(memcpy)
WEAK(memcpy)
#include "copy_template.S"
......
......@@ -24,9 +24,8 @@
* occurring in the opposite direction.
*/
.weak memmove
ENTRY(__memmove)
ENTRY(memmove)
WEAK(memmove)
UNWIND( .fnstart )
subs ip, r0, r1
......
......@@ -13,10 +13,9 @@
.text
.align 5
.weak memset
ENTRY(__memset)
ENTRY(mmioset)
ENTRY(memset)
WEAK(memset)
UNWIND( .fnstart )
ands r3, r0, #3 @ 1 unaligned?
mov ip, r0 @ preserve r0 as return value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部