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 <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel 2016-09-05 13:33:37 +01:00
parent 70c368e26f
commit bc54e50e0f
1 changed files with 9 additions and 0 deletions

View File

@ -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);