1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2018 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for sections, which are entries which can contain other
9 from entry import Entry
15 class Entry_section(Entry):
16 def __init__(self, image, etype, node):
17 Entry.__init__(self, image, etype, node)
18 self._section = bsection.Section(node.name, node)
20 def ProcessFdt(self, fdt):
21 return self._section.ProcessFdt(fdt)
23 def ObtainContents(self):
24 return self._section.GetEntryContents()
27 return self._section.GetData()
29 def GetPositions(self):
30 """Handle entries that want to set the position/size of other entries
32 This calls each entry's GetPositions() method. If it returns a list
33 of entries to update, it updates them.
35 self._section.GetEntryPositions()
39 """Pack all entries into the section"""
40 self._section.PackEntries()
41 self.size = self._section.CheckSize()
42 return super(Entry_section, self).Pack(pos)
44 def WriteSymbols(self, section):
45 """Write symbol values into binary files for access at run time"""
46 self._section.WriteSymbols()
48 def ProcessContents(self):
49 self._section.ProcessEntryContents()
50 super(Entry_section, self).ProcessContents()
52 def CheckPosition(self):
53 self._section.CheckEntries()
55 def WriteMap(self, fd, indent):
56 """Write a map of the section to a .map file
59 fd: File to write the map to
61 super(Entry_section, self).WriteMap(fd, indent)
62 self._section.WriteMap(fd, indent + 1)