1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2016 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for BSS padding for spl/u-boot-spl.bin. This padding
6 # can be added after the SPL binary to ensure that anything concatenated
7 # to it will appear to SPL to be at the end of BSS rather than the start.
12 from entry import Entry
13 from blob import Entry_blob
16 class Entry_u_boot_spl_bss_pad(Entry_blob):
17 def __init__(self, section, etype, node):
18 Entry_blob.__init__(self, section, etype, node)
20 def ObtainContents(self):
21 fname = tools.GetInputFilename('spl/u-boot-spl')
22 bss_size = elf.GetSymbolAddress(fname, '__bss_size')
24 self.Raise('Expected __bss_size symbol in spl/u-boot-spl')
25 self.SetContents(chr(0) * bss_size)