From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: yonghong.zhu@intel.com, liming.gao@intel.com, edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, eugene@hp.com,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 2/3] ArmPkg/CompilerIntrinsicsLib: make the default memset() weak
Date: Thu, 4 Aug 2016 16:42:46 +0200 [thread overview]
Message-ID: <1470321767-26921-3-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1470321767-26921-1-git-send-email-ard.biesheuvel@linaro.org>
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>
---
ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S
index bb75d7a70b80..65f6289b410b 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
--
2.7.4
next prev parent reply other threads:[~2016-08-04 14:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 14:42 [PATCH 0/3] Build fixes for ARM/OpenSSL Ard Biesheuvel
2016-08-04 14:42 ` [PATCH 1/3] ArmPkg/ArmSoftFloatLib: disable LTO build for GCC Ard Biesheuvel
2016-08-06 14:18 ` Michael Zimmermann
2016-08-06 14:42 ` Ard Biesheuvel
2016-08-06 14:53 ` Michael Zimmermann
2016-08-07 9:28 ` Michael Zimmermann
2016-08-07 10:29 ` Ard Biesheuvel
2016-08-04 14:42 ` Ard Biesheuvel [this message]
2016-08-04 14:42 ` [PATCH 3/3] BaseTools GCC/ARM: add -fno-builtin to CC flags Ard Biesheuvel
2016-08-04 16:01 ` Michael Zimmermann
2016-08-05 14:34 ` Ard Biesheuvel
2016-08-05 14:26 ` Gao, Liming
2016-08-05 14:33 ` Ard Biesheuvel
2016-08-05 12:53 ` [PATCH 0/3] Build fixes for ARM/OpenSSL Leif Lindholm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470321767-26921-3-git-send-email-ard.biesheuvel@linaro.org \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox