]>
git.ipfire.org Git - people/ms/u-boot.git/blob - tools/binman/etype/u_boot_spl_bss_pad.py
1 # Copyright (c) 2016 Google, Inc
2 # Written by Simon Glass <sjg@chromium.org>
4 # SPDX-License-Identifier: GPL-2.0+
6 # Entry-type module for BSS padding for spl/u-boot-spl.bin. This padding
7 # can be added after the SPL binary to ensure that anything concatenated
8 # to it will appear to SPL to be at the end of BSS rather than the start.
13 from entry
import Entry
14 from blob
import Entry_blob
17 class Entry_u_boot_spl_bss_pad(Entry_blob
):
18 def __init__(self
, image
, etype
, node
):
19 Entry_blob
.__init
__(self
, image
, etype
, node
)
21 def ObtainContents(self
):
22 fname
= tools
.GetInputFilename('spl/u-boot-spl')
23 bss_size
= elf
.GetSymbolAddress(fname
, '__bss_size')
25 self
.Raise('Expected __bss_size symbol in spl/u-boot-spl')
26 self
.data
= chr(0) * bss_size
27 self
.contents_size
= bss_size