aboutsummaryrefslogtreecommitdiffstats
path: root/support/ld/common_header.inc
diff options
context:
space:
mode:
Diffstat (limited to 'support/ld/common_header.inc')
-rw-r--r--support/ld/common_header.inc39
1 files changed, 39 insertions, 0 deletions
diff --git a/support/ld/common_header.inc b/support/ld/common_header.inc
new file mode 100644
index 0000000..ad1eca2
--- /dev/null
+++ b/support/ld/common_header.inc
@@ -0,0 +1,39 @@
+/* "Preamble" for linker scripts (such as common_rom.inc) */
+
+OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
+ENTRY(_start)
+SEARCH_DIR(.)
+
+/*
+ * Link against libgcc, libc, and libm
+ */
+GROUP(libgcc.a libc.a libm.a)
+
+/* These force the linker to search for particular symbols from
+ * the start of the link process and thus ensure the user's
+ * overrides are picked up
+ */
+INCLUDE names.inc
+
+/* STM32 vector table. See stm32_vector_table.S */
+EXTERN(__cs3_stm32_vector_table)
+
+/* libcs3 C start function. See cs3.h */
+EXTERN(__cs3_start_c)
+
+/* main entry point */
+EXTERN(main)
+
+/* Initial stack pointer value. */
+EXTERN(__cs3_stack)
+PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
+
+/* Reset vector and chip reset entry point. See start.S */
+EXTERN(_start)
+PROVIDE(__cs3_reset = _start);
+
+/* Beginning of the heap */
+PROVIDE(__cs3_heap_start = _end);
+
+/* End of the heap */
+PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);