diff options
author | Simon Glass <sjg@chromium.org> | 2017-11-12 21:52:25 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-11-22 18:05:38 -0700 |
commit | 56509843003570f57f8600642258c77d525da0e5 (patch) | |
tree | 0b2b2566f34c5ac83aba52b4f217f86f0decfafa /tools/binman/test | |
parent | a25ebed36fcf95d09629e8d2e95fdf4907798fb5 (diff) |
binman: Add test for u-boot-spl-bss-pad
Add a test that we can pad the BSS with zero bytes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/test')
-rw-r--r-- | tools/binman/test/47_spl_bss_pad.dts | 17 | ||||
-rw-r--r-- | tools/binman/test/Makefile | 5 | ||||
-rwxr-xr-x | tools/binman/test/bss_data | bin | 0 -> 5020 bytes | |||
-rw-r--r-- | tools/binman/test/bss_data.c | 18 | ||||
-rw-r--r-- | tools/binman/test/bss_data.lds | 16 |
5 files changed, 55 insertions, 1 deletions
diff --git a/tools/binman/test/47_spl_bss_pad.dts b/tools/binman/test/47_spl_bss_pad.dts new file mode 100644 index 0000000000..6bd88b83f9 --- /dev/null +++ b/tools/binman/test/47_spl_bss_pad.dts @@ -0,0 +1,17 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot-spl { + }; + + u-boot-spl-bss-pad { + }; + + u-boot { + }; + }; +}; diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile index 786d1b0577..217d13c666 100644 --- a/tools/binman/test/Makefile +++ b/tools/binman/test/Makefile @@ -11,7 +11,7 @@ CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include 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) @@ -21,6 +21,9 @@ u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c 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) diff --git a/tools/binman/test/bss_data b/tools/binman/test/bss_data Binary files differnew file mode 100755 index 0000000000..afa28282aa --- /dev/null +++ b/tools/binman/test/bss_data diff --git a/tools/binman/test/bss_data.c b/tools/binman/test/bss_data.c new file mode 100644 index 0000000000..f865a9d9f6 --- /dev/null +++ b/tools/binman/test/bss_data.c @@ -0,0 +1,18 @@ +/* + * 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; +} diff --git a/tools/binman/test/bss_data.lds b/tools/binman/test/bss_data.lds new file mode 100644 index 0000000000..6b2fe09d35 --- /dev/null +++ b/tools/binman/test/bss_data.lds @@ -0,0 +1,16 @@ +/* + * 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; +} |