with open(self.TestFile('descriptor.bin')) as fd:
TestFunctional._MakeInputFile('descriptor.bin', fd.read())
+ # ELF file with a '__bss_size' symbol
+ with open(self.TestFile('bss_data')) as fd:
+ TestFunctional._MakeInputFile('spl/u-boot-spl', fd.read())
+
@classmethod
def tearDownClass(self):
"""Remove the temporary input directory and its contents"""
data = self._DoReadFile('46_intel-vbt.dts')
self.assertEqual(VBT_DATA, data[:len(VBT_DATA)])
+ def testSplBssPad(self):
+ """Test that we can pad SPL's BSS with zeros"""
+ data = self._DoReadFile('47_spl_bss_pad.dts')
+ self.assertEqual(U_BOOT_SPL_DATA + (chr(0) * 10) + U_BOOT_DATA, data)
+
if __name__ == "__main__":
unittest.main()
LDS_UCODE := -T u_boot_ucode_ptr.lds
-TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr
+TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data
all: $(TARGETS)
u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
u_boot_ucode_ptr: u_boot_ucode_ptr.c
+bss_data: CFLAGS += bss_data.lds
+bss_data: bss_data.c
+
clean:
rm -f $(TARGETS)
--- /dev/null
+/*
+ * Copyright (c) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * Simple program to create a _dt_ucode_base_size symbol which can be read
+ * by 'nm'. This is used by binman tests.
+ */
+
+int bss_data[10];
+int __bss_size = sizeof(bss_data);
+
+int main()
+{
+ bss_data[2] = 2;
+
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 0xfffffdf0;
+ _start = .;
+ __bss_size = 10;
+}