From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by mx.groups.io with SMTP id smtpd.web09.6080.1616719709364600975 for ; Thu, 25 Mar 2021 17:48:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vv+mzbvj; spf=pass (domain: gmail.com, ip: 209.85.166.179, mailfrom: crawfxrd@gmail.com) Received: by mail-il1-f179.google.com with SMTP id j11so3671791ilu.13 for ; Thu, 25 Mar 2021 17:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Iqs7a9BjAuSxRE+AWnXmk27uDadMSC5lOulnigrKjPU=; b=Vv+mzbvjPK/PA0ItDv3ubYTm2ehdikexfOea73x55sFCdEBdkLmTbzL6X2qh2L1L4j AiD2LEWvq9GmE9J0INma5X1S56ehoeN/Il8HCEUQKxE/BARMqsaoSjW3jeG+zmZB+wL0 y4TNPjGO1ggdUMSWaexpASb4IFPQdIfmAAVZoUp7DXN879iKwiQzqv2lCThxibHhaxBD WlBUEDoJCmJ5dIf8RxOfHq1PLlzt2rFMnIwWdV+gom57pQzpuJRfEHGGcD4bOddt4O4/ hzDjDQRKija45wQ5Sxx6yG6M/FJdmfAvy+ZTAxFPP+Dxpg9D2FDI3MCWV3JCxAPKtq+Z 3nSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Iqs7a9BjAuSxRE+AWnXmk27uDadMSC5lOulnigrKjPU=; b=ULnWE1bxP/lm+k75v2VIVgGJHFgBCdUMfTpvyVL3YCd2vmN5jRKbkL9y9ZBMJq8SD7 ZrmbBQkIZFpifKicDE+p3dJdO+PEoV67dDTA06OkAyxB04CnHU8PCAxXzag7QWq3+mSn LaeUFpggyYVWhHuGshWkzcoPWmoBIdTmk9F1nIOZsdiN48O//V/F7FnKyb3TUVio+KFx rkY78gXdwienc0hlIc+9suCceNnB7eopvKL44Mc3wNAIk7+IF5fVVz+TC2ckFg4dBDIo XR88NRFi1BXCo2nfmrx0OioZh7t9TGdsyYrF78LSRSJ6Gr8Bt+0HYPFNwwBIrjVKEPAr 9Pzg== X-Gm-Message-State: AOAM531cJsysfmkl2R0EMI0Vws/uMQf2Tg+hipIWz67qw2y7xyQv3th5 ms31OieAy8o5WjU+OIu9ZPup7s0eWF8m4w== X-Google-Smtp-Source: ABdhPJyVokoy4K12uKUx71kUr+dITzT3p9i3HArBWMeSGM6/2mrkvB0zGgOlCyAeyDl2RbUXbm7tZg== X-Received: by 2002:a05:6e02:214b:: with SMTP id d11mr8568806ilv.135.1616719708676; Thu, 25 Mar 2021 17:48:28 -0700 (PDT) Return-Path: Received: from hircine.home.lan ([2601:282:700:f::9c8]) by smtp.gmail.com with ESMTPSA id v19sm3298124iol.21.2021.03.25.17.48.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 17:48:28 -0700 (PDT) From: "Tim Crawford" X-Google-Original-From: Tim Crawford To: devel@edk2.groups.io Subject: [PATCH] BaseTools/GenFw: Fix casting result of comparison Date: Thu, 25 Mar 2021 18:48:27 -0600 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The cast in IsDataShdr() is only applied the left side, causing it to always return FALSE. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3271 Signed-off-by: Tim Crawford --- BaseTools/Source/C/GenFw/Elf32Convert.c | 2 +- BaseTools/Source/C/GenFw/Elf64Convert.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c b/BaseTools/Source/C/G= enFw/Elf32Convert.c index 7f351287a9..df54991768 100644 --- a/BaseTools/Source/C/GenFw/Elf32Convert.c +++ b/BaseTools/Source/C/GenFw/Elf32Convert.c @@ -262,7 +262,7 @@ IsDataShdr ( if (IsHiiRsrcShdr(Shdr)) {=0D return FALSE;=0D }=0D - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D (SHF_= ALLOC | SHF_WRITE);=0D + return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D (SHF= _ALLOC | SHF_WRITE));=0D }=0D =0D STATIC=0D diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/G= enFw/Elf64Convert.c index 4ed6b4477e..1bf1e9accb 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -270,7 +270,7 @@ IsDataShdr ( if (IsHiiRsrcShdr(Shdr)) {=0D return FALSE;=0D }=0D - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D (SHF_= ALLOC | SHF_WRITE);=0D + return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D (SHF= _ALLOC | SHF_WRITE));=0D }=0D =0D STATIC=0D --=20 2.30.2