From patchwork Thu Aug 4 14:42:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 73284 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1431419qga; Thu, 4 Aug 2016 07:43:05 -0700 (PDT) X-Received: by 10.66.158.104 with SMTP id wt8mr126080435pab.64.1470321785306; Thu, 04 Aug 2016 07:43:05 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id q11si14999699pfd.42.2016.08.04.07.43.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Aug 2016 07:43:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 54DDE1A1E24; Thu, 4 Aug 2016 07:43:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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 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: [edk2] [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: , Cc: Ard Biesheuvel , leif.lindholm@linaro.org, eugene@hp.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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