]> git.sur5r.net Git - u-boot/blob - tools/binman/etype/u_boot_spl_bss_pad.py
binman: Rename Entry property to 'section'
[u-boot] / tools / binman / etype / u_boot_spl_bss_pad.py
1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2016 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
4 #
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.
8 #
9
10 import command
11 import elf
12 from entry import Entry
13 from blob import Entry_blob
14 import tools
15
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)
19
20     def ObtainContents(self):
21         fname = tools.GetInputFilename('spl/u-boot-spl')
22         bss_size = elf.GetSymbolAddress(fname, '__bss_size')
23         if not bss_size:
24             self.Raise('Expected __bss_size symbol in spl/u-boot-spl')
25         self.data = chr(0) * bss_size
26         self.contents_size = bss_size