public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wang, BruceX" <brucex.wang@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Guo" <guo.dong@intel.com>, "Ni, Ray" <ray.ni@intel.com>,
	"Rhodes, Sean" <sean@starlabs.systems>,
	"Lu, James" <james.lu@intel.com>, "Guo, Gua" <gua.guo@intel.com>
Subject: Re: [PATCH] UefiPayloadPkg: Fix incorrect code on AddSectionHeader
Date: Wed, 14 Jun 2023 14:07:04 +0000	[thread overview]
Message-ID: <IA0PR11MB788377414FCCC86C8F23E05BE55AA@IA0PR11MB7883.namprd11.prod.outlook.com> (raw)
In-Reply-To: <9d76dda748aba4b4614d99227d225c87157c5f84.1686750331.git.brucex.wang@intel.com>



-----Original Message-----
From: Wang, BruceX <brucex.wang@intel.com> 
Sent: Wednesday, June 14, 2023 10:00 PM
To: devel@edk2.groups.io
Cc: Wang, BruceX <brucex.wang@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu, James <james.lu@intel.com>
Subject: [PATCH] UefiPayloadPkg: Fix incorrect code on AddSectionHeader

From: BruceX Wang <brucex.wang@intel.com>

Fix incorrect code on AddSectionHeader32() and AddSectionHeader64()

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: BruceX Wang <brucex.wang@intel.com>
---
 UefiPayloadPkg/Tools/ElfFv.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/Tools/ElfFv.py b/UefiPayloadPkg/Tools/ElfFv.py index a3d5bf08b9..3f0f9272a7 100644
--- a/UefiPayloadPkg/Tools/ElfFv.py
+++ b/UefiPayloadPkg/Tools/ElfFv.py
@@ -267,7 +267,7 @@ def AddSectionHeader64(SHentry, NewUPLEntrylen, SectionHeaderEntrySize, Index, R
         # if RemoveNameOffset != 0 that is remove function.         if (RemoveNameOffset != 0):             if (unpacked_header.sh_name > RemoveNameOffset):-                unpacked_header.sh_name -= RemoveNameOffset+                unpacked_header.sh_name -= len (SectionName)             # Modify size of name string section entry in section entry.             if (Index == StringIndexNumber):                 unpacked_header.sh_size -= len (SectionName)@@ -298,7 +298,7 @@ def AddSectionHeader32(SHentry, NewUPLEntrylen, SectionHeaderEntrySize, Index, R
         # if RemoveNameOffset != 0 that is remove function.         if (RemoveNameOffset != 0):             if (unpacked_header.sh_name > RemoveNameOffset):-                unpacked_header.sh_name -= RemoveNameOffset+                unpacked_header.sh_name -= len (SectionName)             # Modify size of name string section entry in section entry.             if (Index == StringIndexNumber):                 unpacked_header.sh_size -= len (SectionName)@@ -710,7 +710,7 @@ def AddSection32(UniversalPayloadEntry, AddSectionName, ElfHeaderOffset, Section
         ElfHeaderSize = 52         ElfHandPH = ElfHeaderSize + (elf_header.e_phnum * elf_header.e_phentsize)         NewUPLEntry = UPLEntry[:ElfHandPH]-        # Keep Section header and program header table, AddSection64() only recombined section and section header.+        # Keep Section header and program header table, AddSection32() only recombined section and section header.         NewUPLEntry = bytearray(NewUPLEntry)         # Sections is recombined.         # 1. name of added section is added in name string section.-- 
2.39.1.windows.1


  reply	other threads:[~2023-06-14 14:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 14:00 [PATCH] UefiPayloadPkg: Fix incorrect code on AddSectionHeader brucex.wang
2023-06-14 14:07 ` Wang, BruceX [this message]
2023-06-14 14:08   ` Guo, Gua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=IA0PR11MB788377414FCCC86C8F23E05BE55AA@IA0PR11MB7883.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox