From patchwork Fri Jul 3 09:40:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 50616 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1DB88214B3 for ; Fri, 3 Jul 2015 09:40:54 +0000 (UTC) Received: by laer2 with SMTP id r2sf26694129lae.3 for ; Fri, 03 Jul 2015 02:40:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=6uLRlHDqhrw6vMOJMs9JPn/Smy8kg3mPrBL8UuMcXtQ=; b=VmdYeS1AI37twXQ/pScCmJ30TgAFcNLV0fGfSFPoHh81mzfinMdKBTu5LXZue/rkWz BrjOTHlInsXEy8DF5SxlrOF0JXZJ7YFwWoPh11ldtDWXWMppnPmCzy+3+3SlVMmdP140 Nb9lGeq7H8OGFYl1WYWbGzGfXaLwWzupLmC+ZUu/EAix+SKN/k3JyKjEi85AF5CQYRZi CdeG3qB8RF+s3oDJJN0JZFFWRG70Xez3YqAp3RaQ0CMaQapsSlyyfzNubRme+9aHX5lB aWcqt8Z8OQ0Ba9TMNlaz7HM/zwlgXtf4AZHcRh3gfukDxhcFR6UVKZ9Sqn1i354NmQF2 O0ww== X-Gm-Message-State: ALoCoQn+KmhR9agvuICeaeBFAmnJaaSSEYv+Z2pb5TT5Uagnm+AEMRtnZ9W7qqOkfz6mR22JjRdl X-Received: by 10.180.87.201 with SMTP id ba9mr7025381wib.3.1435916453055; Fri, 03 Jul 2015 02:40:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.74 with SMTP id k10ls484932laf.30.gmail; Fri, 03 Jul 2015 02:40:52 -0700 (PDT) X-Received: by 10.152.120.42 with SMTP id kz10mr9781020lab.109.1435916452512; Fri, 03 Jul 2015 02:40:52 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id vk4si6750977lbb.147.2015.07.03.02.40.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 02:40:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by laar3 with SMTP id r3so78782871laa.0 for ; Fri, 03 Jul 2015 02:40:52 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr34954704lbc.19.1435916452403; Fri, 03 Jul 2015 02:40:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1046297lbb; Fri, 3 Jul 2015 02:40:51 -0700 (PDT) X-Received: by 10.42.48.9 with SMTP id q9mr18246739icf.21.1435916450761; Fri, 03 Jul 2015 02:40:50 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id y5si4856817igl.47.2015.07.03.02.40.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 Jul 2015 02:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAxSW-0000HD-W2; Fri, 03 Jul 2015 09:40:36 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAxSV-0000Gv-FK for edk2-devel@lists.sourceforge.net; Fri, 03 Jul 2015 09:40:35 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.48 as permitted sender) client-ip=74.125.82.48; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wg0-f48.google.com; Received: from mail-wg0-f48.google.com ([74.125.82.48]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZAxSU-0003Pn-MB for edk2-devel@lists.sourceforge.net; Fri, 03 Jul 2015 09:40:35 +0000 Received: by wgjx7 with SMTP id x7so83630405wgj.2 for ; Fri, 03 Jul 2015 02:40:28 -0700 (PDT) X-Received: by 10.194.133.73 with SMTP id pa9mr65701584wjb.148.1435916428633; Fri, 03 Jul 2015 02:40:28 -0700 (PDT) Received: from localhost.localdomain ([185.13.106.72]) by mx.google.com with ESMTPSA id fa8sm12986803wib.14.2015.07.03.02.40.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Jul 2015 02:40:27 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, michael.d.kinney@intel.com, Jiewen.Yao@intel.com, liming.gao@intel.com, jordan.l.justen@intel.com Date: Fri, 3 Jul 2015 11:40:03 +0200 Message-Id: <1435916407-29683-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435916407-29683-1-git-send-email-ard.biesheuvel@linaro.org> References: <1435916407-29683-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ZAxSU-0003Pn-MB Subject: [edk2] [PATCH 2/6] MdePkg/BasePeCoffLib: remove redundant handling of EFI_IMAGE_REL_BASED_DIR64 X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The IPF implementation of PeHotRelocateImageEx () handles relocations of type EFI_IMAGE_REL_BASED_DIR64. However, since the caller already handles this type, this is essentially dead code and can be removed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- MdePkg/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/MdePkg/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c b/MdePkg/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c index 96e122b69814..a590f3906fab 100644 --- a/MdePkg/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c +++ b/MdePkg/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c @@ -267,16 +267,6 @@ PeHotRelocateImageEx ( UINT64 FixupVal; switch ((*Reloc) >> 12) { - case EFI_IMAGE_REL_BASED_DIR64: - Fixup64 = (UINT64 *) Fixup; - *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64)); - if (*(UINT64 *) (*FixupData) == *Fixup64) { - *Fixup64 = *Fixup64 + (UINT64) Adjust; - } - - *FixupData = *FixupData + sizeof (UINT64); - break; - case EFI_IMAGE_REL_BASED_IA64_IMM64: Fixup64 = (UINT64 *) Fixup; *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64));