[PATCH] ARM: Change arch/arm/lib/mem*.S to use WEAK instead of .weak

Linus Walleij linus.walleij at linaro.org
Tue Nov 10 09:05:50 EST 2020


On Thu, Nov 5, 2020 at 7:15 PM Fangrui Song <maskray at google.com> wrote:

> Commit d6d51a96c7d6 ("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.
>
> Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")
> Reported-by: Nick Desaulniers <ndesaulniers at google.com>
> Signed-off-by: Fangrui Song <maskray at google.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1190

Acked-by: Linus Walleij <linus.walleij at linaro.org>

When you have consensus that this is working, please put the patch
into Russell's patch tracker.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list