[PATCH] tools: qcom: mkmbn: fix Elf constructor

Casey Connolly casey.connolly at linaro.org
Tue Oct 28 12:13:08 CET 2025


The Elf class constructor was missing two optional parameters: the Ehdr
object and a list of Phdr's to populate the Elf.

Add these back so that the parse() method will work correctly.

Fixes: 9fe658c97f5e ("tools: qcom: add mkmbn.py")
Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
---
 tools/qcom/mkmbn/elf.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/qcom/mkmbn/elf.py b/tools/qcom/mkmbn/elf.py
index 86f12d1f4e5d..7737adc6a4e2 100644
--- a/tools/qcom/mkmbn/elf.py
+++ b/tools/qcom/mkmbn/elf.py
@@ -171,11 +171,11 @@ def _align(i: int, alignment: int) -> int:
 class Elf:
 	ehdr: Ehdr
 	phdrs: List[Phdr]
 
-	def __init__(self):
-		self.ehdr = Ehdr()
-		self.phdrs: List[Phdr] = []
+	def __init__(self, ehdr: Ehdr | None = None, phdrs: List[Phdr] | None = None):
+		self.ehdr = ehdr or Ehdr()
+		self.phdrs: List[Phdr] = phdrs or []
 
 	def total_header_size(self):
 		return self.ehdr.e_phoff + len(self.phdrs) * self.ehdr.e_phentsize
 
-- 
2.51.0



More information about the U-Boot mailing list