aboutsummaryrefslogtreecommitdiff
path: root/nuttx-configs/px4fmu-v1/scripts/ld.script
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx-configs/px4fmu-v1/scripts/ld.script')
-rw-r--r--nuttx-configs/px4fmu-v1/scripts/ld.script58
1 files changed, 42 insertions, 16 deletions
diff --git a/nuttx-configs/px4fmu-v1/scripts/ld.script b/nuttx-configs/px4fmu-v1/scripts/ld.script
index f6560743b..ced5b21b7 100644
--- a/nuttx-configs/px4fmu-v1/scripts/ld.script
+++ b/nuttx-configs/px4fmu-v1/scripts/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
- * configs/stm32f4discovery/scripts/ld.script
+ * configs/px4fmu-v1/scripts/ld.script
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -42,41 +42,67 @@
*
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
* where the code expects to begin execution by jumping to the entry point in
- * the 0x0800:0000 address
- * range.
+ * the 0x0800:0000 address range.
+ *
+ * The first 0x4000 of flash is reserved for the bootloader.
*/
MEMORY
{
- flash (rx) : ORIGIN = 0x08004000, LENGTH = 1008K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
+ flash (rx) : ORIGIN = 0x08004000, LENGTH = 1008K
+ sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
+ ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
}
OUTPUT_ARCH(arm)
-EXTERN(_vectors)
-ENTRY(_stext)
+
+ENTRY(__start) /* treat __start as the anchor for dead code stripping */
+EXTERN(_vectors) /* force the vectors to be included in the output */
+
+/*
+ * Ensure that abort() is present in the final object. The exception handling
+ * code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
+ */
+EXTERN(abort)
+
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
- *(.text .text.*)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata .rodata.*)
+ *(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
+
+ /*
+ * This is a hack to make the newlib libm __errno() call
+ * use the NuttX get_errno_ptr() function.
+ */
+ __errno = get_errno_ptr;
} > flash
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
+ /*
+ * Init functions (static constructors and the like)
+ */
+ .init_section : {
+ _sinit = ABSOLUTE(.);
+ KEEP(*(.init_array .init_array.*))
+ _einit = ABSOLUTE(.);
+ } > flash
+
+ /*
+ * Construction data for parameters.
+ */
+ __param ALIGN(4): {
+ __param_start = ABSOLUTE(.);
+ KEEP(*(__param*))
+ __param_end = ABSOLUTE(.);
} > flash
.ARM.extab : {