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

Neil Armstrong neil.armstrong at linaro.org
Thu Oct 30 09:42:16 CET 2025


On 10/28/25 12:13, Casey Connolly wrote:
> 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
>   

This patch is required to finalize the Qcom PR, I guess it's fine, so LGTM

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>


More information about the U-Boot mailing list