summaryrefslogtreecommitdiff
path: root/ArmPkg/Library/CompilerIntrinsicsLib
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-08-04 16:37:13 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-08-05 16:32:36 +0200
commitf8c51389c6dbc8e99715489f70fb4ad47d49be1f (patch)
treefd8f65551b5b1646b76db5733085a351c23bdbf6 /ArmPkg/Library/CompilerIntrinsicsLib
parent59ceaa0a871d0d14bd54caa8cb9ca24a5314b223 (diff)
downloadedk2-f8c51389c6dbc8e99715489f70fb4ad47d49be1f.zip
edk2-f8c51389c6dbc8e99715489f70fb4ad47d49be1f.tar.gz
edk2-f8c51389c6dbc8e99715489f70fb4ad47d49be1f.tar.bz2
ArmPkg/CompilerIntrinsicsLib: make the default memset() weak
The ARM compiler intrinsics library defines __aeabi_memset() and memset() in the same object, which means that both will be pulled in if either is referenced. The IntrinsicLib in CryptoPkg defines its own, preferred memset(), which may clash with our memset(). So make our version weak. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg/Library/CompilerIntrinsicsLib')
-rw-r--r--ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S
index bb75d7a..65f6289 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S
@@ -40,6 +40,14 @@ ASM_PFX(__aeabi_memset):
# IN UINT32 Character,
# IN UINT32 Size
# );
+ //
+ // This object may be pulled in to satisfy an undefined reference to
+ // __aeabi_memset above, but in some cases, memset() is already provided
+ // by another library (i.e., CryptoPkg/IntrinsicLib), in which case we
+ // prefer the other version. So allow this one to be overridden by
+ // giving it weak linkage.
+ //
+ .weak memset
ASM_PFX(memset):
subs ip, r2, #0
bxeq lr