From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C73E81A1E14 for ; Thu, 4 Aug 2016 07:43:02 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id f65so486610791wmi.0 for ; Thu, 04 Aug 2016 07:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KBGHkd0/t+Dve1zz9KOauAeEReGMqStMka/QJ+tdwNg=; b=PvVi7Lf3Ot5Uus60f5Aiz+INKH6f8tzB2vTNfFr1ejQENczVsGgMq1dIiFv3Ov79bs 3hMpc254Hc8go3iVdx2c1+7op3TzIaj1/mP4waps4k5cqzegcaIE5lybU6lbzGH1qYd/ TLX+xmM6QYAF0yjAMkyxCvsmjZKXFbA7YXVWs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KBGHkd0/t+Dve1zz9KOauAeEReGMqStMka/QJ+tdwNg=; b=BvTzaWzO7VUD9SUhi5GnwMPwv/OyEtGQlTsaN6xaZrPVA+yeNyZyH+DLyGi7/3ARxW aLzXZ4qF3dAqbL0nl+/JwxWGaTTSGJhSgxiJ7YtkiN7nyd/Umc2FSasf5VNkGLjG/F9g +R1f+RtaAlaBaF174NxoHMyumX7L4JILYiH9cEu97GqP5elI+brf6e0SiazIVHBz5Sbk vj6zlfRF810ZTTV7Cpe8/+tsOF0kh+saNMcNcECHMduiRd9/eckiv7IwzEh5PfcMHjQ6 tnTbOl/k1RW6WBj/ull19h9COeFburUjjMAWx6ocufH4tVhFZgyK7vmYgkLmQbJluBHZ 828w== X-Gm-Message-State: AEkoouuFnNsn1XkWSGgvll4/g04XXHcBofpskNU0CNB+lB2E/Yi/Oi3ZonipUkpU/f7Q6r5A X-Received: by 10.28.38.196 with SMTP id m187mr29129940wmm.81.1470321781387; Thu, 04 Aug 2016 07:43:01 -0700 (PDT) Received: from localhost.localdomain (3.red-81-34-118.dynamicip.rima-tde.net. [81.34.118.3]) by smtp.gmail.com with ESMTPSA id va3sm13209789wjb.18.2016.08.04.07.42.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Aug 2016 07:43:00 -0700 (PDT) From: Ard Biesheuvel To: yonghong.zhu@intel.com, liming.gao@intel.com, edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, eugene@hp.com, Ard Biesheuvel Date: Thu, 4 Aug 2016 16:42:46 +0200 Message-Id: <1470321767-26921-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470321767-26921-1-git-send-email-ard.biesheuvel@linaro.org> References: <1470321767-26921-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH 2/3] ArmPkg/CompilerIntrinsicsLib: make the default memset() weak X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2016 14:43:03 -0000 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 --- 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