From bc54e50e0fe03c570014f363b547426913e92449 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 5 Sep 2016 13:33:37 +0100 Subject: ArmPkg/CompilerIntrinsicsLib ARM: make memset() weak again After the recent update of CompilerIntrinsicsLib, our memset() is no longer emitted as a weak symbol. On ARM, this may cause problems when combining this library with another library that supplies memset() [e.g., CryptoPkg/IntrinsicLib], due to the fact that the object also supplies the __aeabi_memXXX entry points, which can only be satisfied by this object. So make our memset() weak again, to let the other implementation take precedence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ArmPkg/Library/CompilerIntrinsicsLib') diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c index 3d417d7972..0d837fcecf 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c +++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c @@ -31,6 +31,15 @@ void *memset(void *dest, int c, size_t n); #ifdef __arm__ +// +// Other modules (such as CryptoPkg/IntrinsicLib) may provide another +// implementation of memset(), which may conflict with this one if this +// object was pulled into the link due to the definitions below. So make +// our memset() 'weak' to let the other implementation take precedence. +// +__attribute__((__weak__)) +void *memset(void *dest, int c, size_t n); + void __aeabi_memset(void *dest, size_t n, int c) { __memset(dest, c, n); -- cgit v1.2.3