binman: Add a ELF test file with disjoint text sections
[platform/kernel/u-boot.git] / tools / binman / test / elf_sections.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright 2022 Google LLC
4  *
5  * Program containing two text sections
6  */
7
8 int __attribute__((section(".sram_data"))) data[29];
9
10 int __attribute__((section(".sram_code"))) calculate(int x)
11 {
12         data[0] = x;
13
14         return x * x;
15 }
16
17 int main(void)
18 {
19         return calculate(123);
20 }