]> git.ipfire.org Git - people/ms/u-boot.git/blob - tools/binman/etype/u_boot_spl_bss_pad.py
Merge git://git.denx.de/u-boot-sunxi
[people/ms/u-boot.git] / tools / binman / etype / u_boot_spl_bss_pad.py
1 # Copyright (c) 2016 Google, Inc
2 # Written by Simon Glass <sjg@chromium.org>
3 #
4 # SPDX-License-Identifier: GPL-2.0+
5 #
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.
9 #
10
11 import command
12 import elf
13 from entry import Entry
14 from blob import Entry_blob
15 import tools
16
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)
20
21 def ObtainContents(self):
22 fname = tools.GetInputFilename('spl/u-boot-spl')
23 bss_size = elf.GetSymbolAddress(fname, '__bss_size')
24 if not 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