From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by mx.groups.io with SMTP id smtpd.web10.11419.1689261889366573094 for ; Thu, 13 Jul 2023 08:24:49 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=I0bZqNpB; spf=pass (domain: gmail.com, ip: 209.85.166.172, mailfrom: joey.vagedes@gmail.com) Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-345df4e68afso3464785ab.0 for ; Thu, 13 Jul 2023 08:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689261888; x=1691853888; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lydTXZRKRVfQXQfTfnZFVPiWZA5kuZJ+l3dWfdn2sC0=; b=I0bZqNpBK7QONY3UgLr7tgQTbfuXd9L33oVB61XWFlmQ22etn4s9OaEIviBIjuCEtY k+RMBUbYDNaTGfT0ZyHZK6jf5GbBLdk/8Yeict5I+nKoF279thQvaOoRTl6YWROla5QR cMXCnKM/Le4cl/HubGNGNGct80ONKAQIsDlNdyFBrIZlEavJtPc5ggLsJCfiv1ZJupCo pgwm8qpnXLj6B4OzioRqbYFHYmXwL4xkHnHHUXAdwLkGs/CyPiig3X3FQtkuxg7WpkhP yLtdhstuxhEBkbjAz3oMT6wR5xhrFJnGCpeYhMsUIeNFPnNliwZpVcM1HQcwHJZHBgOR JbDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689261888; x=1691853888; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lydTXZRKRVfQXQfTfnZFVPiWZA5kuZJ+l3dWfdn2sC0=; b=gysVgNQIjFEOq4KUyFrW+lmcdFpVCfPFastF1grhHkMiAwQDfNQtDwv0rVk+N3S3Tm qaAYrf/jt7iZh7ME252qSNEkXLiiCIj9BsGNllnQlhnITEMFHinJf2hxyT/adytN4RAR OiKqMu3uaPHjFl5uUO7OXi64TrikBPjp4Yh9yI7yF9S4GP0H8Z1dFdd8kZ6Msp1YLLGN GtMAk1On6lHve5Nu/NjNNeZF+ie6o7GbR1K1Sk0zpxae9HGoRx7vGhsmBz5viDTUc2zM QPH2uSGYPGJZlXNduMH3E3UfxQ6+10aZppdcDrxmLnqcbF2IPQuA5BSiKTAikAdMLS6V 1Yvw== X-Gm-Message-State: ABy/qLYEdnsWogmUZuM/fYft514W0QirFQ+4iUXDmAx9EUoSvn3DeuZJ YSFGsThDoPWjcWRdKEPZmfFUi/Gmshg= X-Google-Smtp-Source: APBJJlGSVyjt0XCDw0oOyQ+xv+mjkGqJcLiJO5zQWjWjHKo8ri7p+YhBQkVbPp3Kvpq4vMeYr1Ecaw== X-Received: by 2002:a92:dc92:0:b0:340:54f1:35dc with SMTP id c18-20020a92dc92000000b0034054f135dcmr1759381iln.18.1689261888178; Thu, 13 Jul 2023 08:24:48 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([174.164.102.13]) by smtp.gmail.com with ESMTPSA id p9-20020a17090a74c900b00263ba6a248bsm12023610pjl.1.2023.07.13.08.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 08:24:47 -0700 (PDT) From: "Joey Vagedes" To: devel@edk2.groups.io Cc: Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen Subject: [PATCH v3 0/2] Automatically set NXCOMPAT bit if requirements are met Date: Thu, 13 Jul 2023 08:24:34 -0700 Message-ID: <20230713152436.220-1-joey.vagedes@gmail.com> X-Mailer: git-send-email 2.41.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit v3: Updates function to be Doxygen compliant v3: Updates commit message v2: Adds --nonxcompat flag to GenFw; updates man page v2: Updates PeImage.h to reference spec 9.3 rather then 8.3 Utilize GenFw to automatically set the NXCOMPAT bit of the DLL Characteristics field of the Optional Header if the following requirements are met: 1. It is a 64bit PE 2. The section alignment is evently divisible by 4K 3. No section is both EFI_IMAGE_SCN_MEM_EXECUTE and EFI_IMAGE_SCN_MEM_WRITE Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Joey Vagedes (2): MdePkg: IndustryStandard: Add DLL Characteristics BaseTools: GenFw: auto-set nxcompat flag MdePkg/Include/IndustryStandard/PeImage.h | 17 +- BaseTools/Source/C/GenFw/GenFw.c | 69 ++++ BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf | 420 +++++++++++--------- 3 files changed, 308 insertions(+), 198 deletions(-) -- 2.41.0.windows.2