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 AddMissingProperties(self):
24 Entry.AddMissingProperties(self)
25 self._section.AddMissingProperties()
27 def ObtainContents(self):
28 return self._section.GetEntryContents()
31 return self._section.GetData()
33 def GetPositions(self):
34 """Handle entries that want to set the position/size of other entries
36 This calls each entry's GetPositions() method. If it returns a list
37 of entries to update, it updates them.
39 self._section.GetEntryPositions()
43 """Pack all entries into the section"""
44 self._section.PackEntries()
45 self.size = self._section.CheckSize()
46 return super(Entry_section, self).Pack(pos)
48 def WriteSymbols(self, section):
49 """Write symbol values into binary files for access at run time"""
50 self._section.WriteSymbols()
52 def SetCalculatedProperties(self):
53 Entry.SetCalculatedProperties(self)
54 self._section.SetCalculatedProperties()
56 def ProcessContents(self):
57 self._section.ProcessEntryContents()
58 super(Entry_section, self).ProcessContents()
60 def CheckPosition(self):
61 self._section.CheckEntries()
63 def WriteMap(self, fd, indent):
64 """Write a map of the section to a .map file
67 fd: File to write the map to
69 super(Entry_section, self).WriteMap(fd, indent)
70 self._section.WriteMap(fd, indent + 1)