summaryrefslogtreecommitdiff
path: root/tools/binman/test/elf_sections.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/test/elf_sections.c')
-rw-r--r--tools/binman/test/elf_sections.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/binman/test/elf_sections.c b/tools/binman/test/elf_sections.c
new file mode 100644
index 00000000000..9bcce9af021
--- /dev/null
+++ b/tools/binman/test/elf_sections.c
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Program containing two text sections
+ */
+
+int __attribute__((section(".sram_data"))) data[29];
+
+int __attribute__((section(".sram_code"))) calculate(int x)
+{
+ data[0] = x;
+
+ return x * x;
+}
+
+int main(void)
+{
+ return calculate(123);
+}