Index: c/src/lib/libbsp/arm/ChangeLog
===================================================================
--- c/src/lib/libbsp/arm/ChangeLog	(revision 87b4f1237ce8ea5417f71a3c4b49e36bf59a7158)
+++ c/src/lib/libbsp/arm/ChangeLog	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -1,2 +1,16 @@
+2010-12-03	Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+	* preinstall.am, shared/lpc/include/lpc-i2s.h,
+	shared/startup/linkcmds.armv4, shared/startup/linkcmds.armv7: New
+	files.
+	* Makefile.am: Added header and linker command files intended to be
+	used by every ARM BSP.
+	* shared/startup/linkcmds.base: Support for EABI and ARM ELF standard.
+	* shared/include/linker-symbols.h: Update due to linker command file
+	changes.
+	* shared/start/start.S, shared/include/start.h: Renamed entry symbol
+	from start to _start to avoid namespace conflicts.  Update due to
+	linker command file changes.
+
 2010-11-23	Gedare Bloom <giddyup44@yahoo.com>
 
Index: c/src/lib/libbsp/arm/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/Makefile.am	(revision 87b4f1237ce8ea5417f71a3c4b49e36bf59a7158)
+++ c/src/lib/libbsp/arm/Makefile.am	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -10,4 +10,11 @@
 SUBDIRS = @RTEMS_BSP_FAMILY@
 
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS = shared/include/linker-symbols.h
+
+dist_project_lib_DATA = shared/startup/linkcmds.base
+dist_project_lib_DATA += shared/startup/linkcmds.armv4
+dist_project_lib_DATA += shared/startup/linkcmds.armv7
+
 EXTRA_DIST =
 
@@ -19,4 +26,5 @@
 EXTRA_DIST += shared/abort/simple_abort.c
 
+include $(srcdir)/preinstall.am
 include $(top_srcdir)/../../../automake/subdirs.am
 include $(top_srcdir)/../../../automake/local.am
Index: c/src/lib/libbsp/arm/preinstall.am
===================================================================
--- c/src/lib/libbsp/arm/preinstall.am	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
+++ c/src/lib/libbsp/arm/preinstall.am	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -0,0 +1,41 @@
+## Automatically generated by ampolish3 - Do not edit
+
+if AMPOLISH3
+$(srcdir)/preinstall.am: Makefile.am
+	$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
+endif
+
+PREINSTALL_DIRS =
+DISTCLEANFILES = $(PREINSTALL_DIRS)
+
+all-am: $(PREINSTALL_FILES)
+
+PREINSTALL_FILES =
+CLEANFILES = $(PREINSTALL_FILES)
+
+$(PROJECT_LIB)/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_LIB)
+	@: > $(PROJECT_LIB)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/bsp/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
+	@: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+
+$(PROJECT_INCLUDE)/bsp/linker-symbols.h: shared/include/linker-symbols.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/linker-symbols.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/linker-symbols.h
+
+$(PROJECT_LIB)/linkcmds.base: shared/startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
+
+$(PROJECT_LIB)/linkcmds.armv4: shared/startup/linkcmds.armv4 $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.armv4
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.armv4
+
+$(PROJECT_LIB)/linkcmds.armv7: shared/startup/linkcmds.armv7 $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.armv7
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.armv7
+
Index: c/src/lib/libbsp/arm/shared/include/linker-symbols.h
===================================================================
--- c/src/lib/libbsp/arm/shared/include/linker-symbols.h	(revision 87b4f1237ce8ea5417f71a3c4b49e36bf59a7158)
+++ c/src/lib/libbsp/arm/shared/include/linker-symbols.h	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -75,4 +75,5 @@
 LINKER_SYMBOL(bsp_section_text_size)
 LINKER_SYMBOL(bsp_section_text_load_begin)
+LINKER_SYMBOL(bsp_section_text_load_end)
 
 LINKER_SYMBOL(bsp_section_rodata_begin)
@@ -80,4 +81,5 @@
 LINKER_SYMBOL(bsp_section_rodata_size)
 LINKER_SYMBOL(bsp_section_rodata_load_begin)
+LINKER_SYMBOL(bsp_section_rodata_load_end)
 
 LINKER_SYMBOL(bsp_section_data_begin)
@@ -85,9 +87,17 @@
 LINKER_SYMBOL(bsp_section_data_size)
 LINKER_SYMBOL(bsp_section_data_load_begin)
+LINKER_SYMBOL(bsp_section_data_load_end)
 
-LINKER_SYMBOL(bsp_section_fast_begin)
-LINKER_SYMBOL(bsp_section_fast_end)
-LINKER_SYMBOL(bsp_section_fast_size)
-LINKER_SYMBOL(bsp_section_fast_load_begin)
+LINKER_SYMBOL(bsp_section_fast_text_begin)
+LINKER_SYMBOL(bsp_section_fast_text_end)
+LINKER_SYMBOL(bsp_section_fast_text_size)
+LINKER_SYMBOL(bsp_section_fast_text_load_begin)
+LINKER_SYMBOL(bsp_section_fast_text_load_end)
+
+LINKER_SYMBOL(bsp_section_fast_data_begin)
+LINKER_SYMBOL(bsp_section_fast_data_end)
+LINKER_SYMBOL(bsp_section_fast_data_size)
+LINKER_SYMBOL(bsp_section_fast_data_load_begin)
+LINKER_SYMBOL(bsp_section_fast_data_load_end)
 
 LINKER_SYMBOL(bsp_section_bss_begin)
@@ -107,4 +117,8 @@
 LINKER_SYMBOL(bsp_vector_table_size)
 
+#define BSP_FAST_TEXT_SECTION __attribute__((section(".bsp_fast_text")))
+
+#define BSP_FAST_DATA_SECTION __attribute__((section(".bsp_fast_data")))
+
 /** @} */
 
Index: c/src/lib/libbsp/arm/shared/include/start.h
===================================================================
--- c/src/lib/libbsp/arm/shared/include/start.h	(revision 87b4f1237ce8ea5417f71a3c4b49e36bf59a7158)
+++ c/src/lib/libbsp/arm/shared/include/start.h	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -39,5 +39,5 @@
  */
 
-#define BSP_START_SECTION __attribute__((section(".bsp_start")))
+#define BSP_START_TEXT_SECTION __attribute__((section(".bsp_start_text")))
 
 #define BSP_START_DATA_SECTION __attribute__((section(".bsp_start_data")))
@@ -46,5 +46,5 @@
 * @brief System start entry.
 */
-void start(void);
+void _start(void);
 
 /**
Index: c/src/lib/libbsp/arm/shared/lpc/include/lpc-i2s.h
===================================================================
--- c/src/lib/libbsp/arm/shared/lpc/include/lpc-i2s.h	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
+++ c/src/lib/libbsp/arm/shared/lpc/include/lpc-i2s.h	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -0,0 +1,131 @@
+/**
+ * @file
+ *
+ * @ingroup lpc_i2s
+ *
+ * @brief I2S API.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef LIBBSP_ARM_SHARED_LPC_I2S_H
+#define LIBBSP_ARM_SHARED_LPC_I2S_H
+
+#include <bsp/utility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup lpc_dma I2S Support
+ *
+ * @ingroup lpc
+ *
+ * @brief I2S support.
+ *
+ * @{
+ */
+
+/**
+ * @brief I2S control block.
+ */
+typedef struct {
+  uint32_t dao;
+  uint32_t dai;
+  uint32_t txfifo;
+  uint32_t rxfifo;
+  uint32_t state;
+  uint32_t dma [2];
+  uint32_t irq;
+  uint32_t txrate;
+  uint32_t rxrate;
+} lpc_i2s;
+
+/**
+ * @name I2S Digital Audio Input and Output
+ *
+ * @{
+ */
+
+#define I2S_DAIO_WORDWIDTH(val) BSP_FLD32(val, 0, 1)
+#define I2S_DAIO_MONO BSP_BIT32(2)
+#define I2S_DAIO_STOP BSP_BIT32(3)
+#define I2S_DAIO_RESET BSP_BIT32(4)
+#define I2S_DAIO_WS_SEL BSP_BIT32(5)
+#define I2S_DAIO_WS_HALFPERIOD(val) BSP_FLD32(val, 6, 14)
+#define I2S_DAIO_MUTE BSP_BIT32(15)
+
+/** @} */
+
+/**
+ * @name I2S Status Feedback
+ *
+ * @{
+ */
+
+#define I2S_STATE_IRQ BSP_BIT32(0)
+#define I2S_STATE_DMAREQ_0 BSP_BIT32(1)
+#define I2S_STATE_DMAREQ_1 BSP_BIT32(2)
+#define I2S_STATE_RX_LEVEL_GET(reg) BSP_FLD32GET(reg, 8, 11)
+#define I2S_STATE_TX_LEVEL_GET(reg) BSP_FLD32GET(reg, 16, 19)
+
+/** @} */
+
+/**
+ * @name I2S DMA Configuration
+ *
+ * @{
+ */
+
+#define I2S_DMA_RX_ENABLE BSP_BIT32(0)
+#define I2S_DMA_TX_ENABLE BSP_BIT32(1)
+#define I2S_DMA_RX_DEPTH(val) BSP_FLD32(val, 8, 11)
+#define I2S_DMA_TX_DEPTH(val) BSP_FLD32(val, 16, 19)
+
+/** @} */
+
+/**
+ * @name I2S Interrupt Request Control
+ *
+ * @{
+ */
+
+#define I2S_IRQ_RX BSP_BIT32(0)
+#define I2S_IRQ_TX BSP_BIT32(1)
+#define I2S_IRQ_RX_DEPTH(val) BSP_FLD32(val, 8, 11)
+#define I2S_IRQ_TX_DEPTH(val) BSP_FLD32(val, 16, 19)
+
+/** @} */
+
+/**
+ * @name I2S Transmit and Receive Clock Rate
+ *
+ * @{
+ */
+
+#define LPC24XX_I2S_RATE(val) BSP_FLD32(val, 0, 9)
+#define LPC32XX_I2S_RATE_X_DIVIDER BSP_FLD32(val, 0, 7)
+#define LPC32XX_I2S_RATE_Y_DIVIDER BSP_FLD32(val, 8, 15)
+
+/** @} */
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_ARM_SHARED_LPC_I2S_H */
Index: c/src/lib/libbsp/arm/shared/start/start.S
===================================================================
--- c/src/lib/libbsp/arm/shared/start/start.S	(revision 87b4f1237ce8ea5417f71a3c4b49e36bf59a7158)
+++ c/src/lib/libbsp/arm/shared/start/start.S	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -33,8 +33,8 @@
 /* Global symbols */
 
-.globl start
+.globl _start
 .globl bsp_start_memcpy
 
-.section ".bsp_start", "ax"
+.section ".bsp_start_text", "ax"
 
 .arm
@@ -64,5 +64,5 @@
 	.word	BSP_START_RESET_VECTOR
 #else
-	.word	start
+	.word	_start
 #endif
 
@@ -97,5 +97,5 @@
 /* Start entry */
 
-start:
+_start:
 
 	/*
Index: c/src/lib/libbsp/arm/shared/startup/linkcmds.armv4
===================================================================
--- c/src/lib/libbsp/arm/shared/startup/linkcmds.armv4	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
+++ c/src/lib/libbsp/arm/shared/startup/linkcmds.armv4	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -0,0 +1,38 @@
+/**
+ * @file
+ *
+ * @ingroup bsp_linker
+ *
+ * @brief Linker command file for ARMv4T architecture.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 128;
+bsp_stack_abt_size = ALIGN (bsp_stack_abt_size, bsp_stack_align);
+
+bsp_stack_fiq_size = DEFINED (bsp_stack_fiq_size) ? bsp_stack_fiq_size : 128;
+bsp_stack_fiq_size = ALIGN (bsp_stack_fiq_size, bsp_stack_align);
+
+bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 512;
+bsp_stack_irq_size = ALIGN (bsp_stack_irq_size, bsp_stack_align);
+
+bsp_stack_svc_size = DEFINED (bsp_stack_svc_size) ? bsp_stack_svc_size : 512;
+bsp_stack_svc_size = ALIGN (bsp_stack_svc_size, bsp_stack_align);
+
+bsp_stack_und_size = DEFINED (bsp_stack_und_size) ? bsp_stack_und_size : 128;
+bsp_stack_und_size = ALIGN (bsp_stack_und_size, bsp_stack_align);
+
+INCLUDE linkcmds.base
Index: c/src/lib/libbsp/arm/shared/startup/linkcmds.armv7
===================================================================
--- c/src/lib/libbsp/arm/shared/startup/linkcmds.armv7	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
+++ c/src/lib/libbsp/arm/shared/startup/linkcmds.armv7	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -0,0 +1,26 @@
+/**
+ * @file
+ *
+ * @ingroup bsp_linker
+ *
+ * @brief Linker command file for ARMv7 architecture.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+bsp_stack_main_size = DEFINED (bsp_stack_main_size) ? bsp_stack_main_size : 4096;
+bsp_stack_main_size = ALIGN (bsp_stack_main_size, bsp_stack_align);
+
+INCLUDE linkcmds.base
Index: c/src/lib/libbsp/arm/shared/startup/linkcmds.base
===================================================================
--- c/src/lib/libbsp/arm/shared/startup/linkcmds.base	(revision 87b4f1237ce8ea5417f71a3c4b49e36bf59a7158)
+++ c/src/lib/libbsp/arm/shared/startup/linkcmds.base	(revision a3579d3b2d2b3daef0040072440b6aa07e5887bf)
@@ -8,13 +8,15 @@
 
 /*
- * Copyright (c) 2008
- * Embedded Brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * rtems@embedded-brains.de
+ * Copyright (c) 2008-2010 embedded brains GmbH.  All rights reserved.
  *
- * The license and distribution terms for this file may be found in the file
- * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
  */
 
@@ -23,80 +25,52 @@
 OUTPUT_ARCH (arm)
 
-ENTRY (start)
-
-bsp_vector_table_size = 64;
+ENTRY (_start)
 
 /*
- * BSP: Global symbols that may be defined externally
+ * Global symbols that may be defined externally
  */
 
-bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 4;
-
-bsp_section_align = DEFINED (bsp_section_align) ? bsp_section_align : 32;
-
-bsp_section_start_end_align = DEFINED (bsp_section_start_end_align) ? bsp_section_start_end_align : bsp_section_align;
-bsp_section_vector_end_align = DEFINED (bsp_section_vector_end_align) ? bsp_section_vector_end_align : bsp_section_align;
-bsp_section_text_end_align = DEFINED (bsp_section_text_end_align) ? bsp_section_text_end_align : bsp_section_align;
-bsp_section_rodata_end_align = DEFINED (bsp_section_rodata_end_align) ? bsp_section_rodata_end_align : bsp_section_align;
-bsp_section_data_end_align = DEFINED (bsp_section_data_end_align) ? bsp_section_data_end_align : bsp_section_align;
-bsp_section_fast_end_align = DEFINED (bsp_section_fast_end_align) ? bsp_section_fast_end_align : bsp_section_align;
-bsp_section_bss_end_align = DEFINED (bsp_section_bss_end_align) ? bsp_section_bss_end_align : bsp_section_align;
+bsp_vector_table_size = DEFINED (bsp_vector_table_size) ? bsp_vector_table_size : 64;
 
 bsp_section_vbarrier_align = DEFINED (bsp_section_vbarrier_align) ? bsp_section_vbarrier_align : 1;
 bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1;
 
-bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 128;
+bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 8;
+
+bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 0;
 bsp_stack_abt_size = ALIGN (bsp_stack_abt_size, bsp_stack_align);
 
-bsp_stack_fiq_size = DEFINED (bsp_stack_fiq_size) ? bsp_stack_fiq_size : 128;
+bsp_stack_fiq_size = DEFINED (bsp_stack_fiq_size) ? bsp_stack_fiq_size : 0;
 bsp_stack_fiq_size = ALIGN (bsp_stack_fiq_size, bsp_stack_align);
 
-bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 512;
+bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 0;
 bsp_stack_irq_size = ALIGN (bsp_stack_irq_size, bsp_stack_align);
 
-bsp_stack_svc_size = DEFINED (bsp_stack_svc_size) ? bsp_stack_svc_size : 512;
+bsp_stack_svc_size = DEFINED (bsp_stack_svc_size) ? bsp_stack_svc_size : 0;
 bsp_stack_svc_size = ALIGN (bsp_stack_svc_size, bsp_stack_align);
 
-bsp_stack_und_size = DEFINED (bsp_stack_und_size) ? bsp_stack_und_size : 128;
+bsp_stack_und_size = DEFINED (bsp_stack_und_size) ? bsp_stack_und_size : 0;
 bsp_stack_und_size = ALIGN (bsp_stack_und_size, bsp_stack_align);
+
+bsp_stack_main_size = DEFINED (bsp_stack_main_size) ? bsp_stack_main_size : 0;
+bsp_stack_main_size = ALIGN (bsp_stack_main_size, bsp_stack_align);
+
+/* FIXME: This should go away when LD is fixed */
+bsp_section_align = DEFINED (bsp_section_align) ? bsp_section_align : 32;
 
 SECTIONS {
 	.start : {
-		/*
-		 * BSP: Begin of start section
-		 */
 		bsp_section_start_begin = .;
-
-		/*
-		 * BSP: System startup entry
-		 */
-		KEEP (*(.bsp_start))
+		KEEP (*(.bsp_start_text))
 		KEEP (*(.bsp_start_data))
-
-		. = ALIGN (bsp_section_start_end_align);
-
-		/*
-		 * BSP: End of start section
-		 */
+		. = ALIGN (bsp_section_align);
 		bsp_section_start_end = .;
 	} > REGION_START AT > REGION_START
-
 	bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
 
 	.vector : {
-		/*
-		 * BSP: Begin of vector section
-		 */
 		bsp_section_vector_begin = .;
 
-		/*
-		 * BSP: Reserve space for the the exception vector table and
-		 * the pointers to the default exceptions handlers.
-		 */
 		. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
-
-		/*
-		 * BSP: Reserve space for mode stacks
-		 */
 
 		. = ALIGN (bsp_stack_align);
@@ -122,19 +96,13 @@
 		bsp_stack_und_end = .;
 
-		/*
-		 * BSP: Special vector data
-		 */
+		bsp_stack_main_begin = .;
+		. = . + bsp_stack_main_size;
+		bsp_stack_main_end = .;
+
 		*(.bsp_vector)
-
-		. = ALIGN (bsp_section_vector_end_align);
-
-		/*
-		 * BSP: End of vector section
-		 */
+		. = ALIGN (bsp_section_align);
 		bsp_section_vector_end = .;
 	} > REGION_VECTOR AT > REGION_VECTOR
-
 	bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin;
-
 	bsp_vector_table_begin = DEFINED (bsp_vector_table_in_start_section) ? bsp_section_start_begin : bsp_section_vector_begin;
 	bsp_vector_table_end = bsp_vector_table_begin + bsp_vector_table_size;
@@ -144,106 +112,162 @@
 	} > REGION_VECTOR
 
+	.interp : {
+		bsp_section_text_begin = .;
+		*(.interp)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.note.gnu.build-id : {
+		*(.note.gnu.build-id)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.hash : {
+		*(.hash)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.gnu.hash : {
+		*(.gnu.hash)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.dynsym : {
+		*(.dynsym)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.dynstr : {
+		*(.dynstr)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.gnu.version : {
+		*(.gnu.version)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.gnu.version_d : {
+		*(.gnu.version_d)
+		. = ALIGN (bsp_section_align);
+	}
+	> REGION_TEXT AT > REGION_TEXT_LOAD
+	.gnu.version_r : {
+		*(.gnu.version_r)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.rel.dyn : {
+		*(.rel.init)
+		*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+		*(.rel.fini)
+		*(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+		*(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+		*(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+		*(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+		*(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+		*(.rel.ctors)
+		*(.rel.dtors)
+		*(.rel.got)
+		*(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+		PROVIDE_HIDDEN (__rel_iplt_start = .);
+		*(.rel.iplt)
+		PROVIDE_HIDDEN (__rel_iplt_end = .);
+		PROVIDE_HIDDEN (__rela_iplt_start = .);
+		PROVIDE_HIDDEN (__rela_iplt_end = .);
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.rela.dyn : {
+		*(.rela.init)
+		*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+		*(.rela.fini)
+		*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+		*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+		*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+		*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+		*(.rela.ctors)
+		*(.rela.dtors)
+		*(.rela.got)
+		*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+		PROVIDE_HIDDEN (__rel_iplt_start = .);
+		PROVIDE_HIDDEN (__rel_iplt_end = .);
+		PROVIDE_HIDDEN (__rela_iplt_start = .);
+		*(.rela.iplt)
+		PROVIDE_HIDDEN (__rela_iplt_end = .);
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.rel.plt : {
+		*(.rel.plt)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.rela.plt : {
+		*(.rela.plt)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.init : {
+		KEEP (*(.init))
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.fini : {
+		KEEP (*(.fini))
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.plt : {
+		*(.plt)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	.iplt : {
+		*(.iplt)
+		. = ALIGN (bsp_section_align);
+	} > REGION_TEXT AT > REGION_TEXT_LOAD
 	.text : {
-		/*
-		 * BSP: Begin of text section
-		 */
-		bsp_section_text_begin = .;
-
-		/*
-		 * BSP: Moved into .text from .init
-		 */
-		KEEP (*(.init))
-
+		*(.text.unlikely .text.*_unlikely)
 		*(.text .stub .text.* .gnu.linkonce.t.*)
-		KEEP (*(.text.*personality*))
 		/* .gnu.warning sections are handled specially by elf32.em.  */
 		*(.gnu.warning)
-
-		/*
-		 * BSP: Magic ARM stuff
-		 */
-		*(.ARM.*)
-		*(.glue_7)
-		*(.glue_7t)
-		*(.vfp11_veneer)
-		
-		/*
-		 * BSP: Special FreeBSD sysctl sections
-		 */
-		. = ALIGN (16);
-		__start_set_sysctl_set = .;
-		*(set_sysctl_*);
-		__stop_set_sysctl_set = ABSOLUTE(.);
-		*(set_domain_*);
-		*(set_pseudo_*);
-
-		/*
-		 * BSP: Moved into .text from .*
-		 */
-		*(.eh_frame_hdr)
-
-		/*
-		 * BSP: Required by cpukit/score/src/threadhandler.c
-		 */
-		PROVIDE (_fini = .);
-
-		/*
-		 * BSP: Moved into .text from .fini
-		 */
-		KEEP (*(.fini))
-
-		. = ALIGN (bsp_section_text_end_align);
-
-		/*
-		 * BSP: End of text section
-		 */
+		*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
+		. = ALIGN (bsp_section_align);
 		bsp_section_text_end = .;
 	} > REGION_TEXT AT > REGION_TEXT_LOAD
-
 	bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
-
-	bsp_section_text_load_begin = LOADADDR (.text);
-
-	.rodata : {
-		/*
-		 * BSP: Begin of rodata section
-		 */
+	bsp_section_text_load_begin = LOADADDR (.interp);
+	bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
+
+	.rodata1 : {
 		bsp_section_rodata_begin = .;
-
-		__start_set_modmetadata_set = .;
-		*(set_modmetadata_set);
-		__stop_set_modmetadata_set = .;
-
-		/*
-		 * BSP: Moved into .rodata from .*
-		 */
-		*(.rodata .rodata.* .gnu.linkonce.r.*)
 		*(.rodata1)
-
-		. = ALIGN (bsp_section_rodata_end_align);
-
-		/*
-		 * BSP: End of rodata section
-		 */
-		bsp_section_rodata_end = .;
-	} > REGION_RODATA AT > REGION_RODATA_LOAD
-
-	bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
-
-	bsp_section_rodata_load_begin = LOADADDR (.rodata);
-
-	.robarrier : {
-		. = ALIGN (bsp_section_robarrier_align);
-	} > REGION_RODATA
-
-	.data : {
-		/*
-		 * BSP: Begin of data section
-		 */
-		bsp_section_data_begin = .;
-
-		/*
-		 * BSP: Moved into .data from .ctors
-		 */
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.ARM.extab : {
+		*(.ARM.extab* .gnu.linkonce.armextab.*)
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.ARM.exidx : {
+		__exidx_start = .;
+		*(.ARM.exidx* .gnu.linkonce.armexidx.*)
+		__exidx_end = .;
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.eh_frame : {
+		KEEP (*(.eh_frame))
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.gcc_except_table : {
+		*(.gcc_except_table .gcc_except_table.*)
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.preinit_array : {
+		PROVIDE_HIDDEN (__preinit_array_start = .);
+		KEEP (*(.preinit_array))
+		PROVIDE_HIDDEN (__preinit_array_end = .);
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT(.init_array.*)))
+		KEEP (*(.init_array))
+		PROVIDE_HIDDEN (__init_array_end = .);
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(.fini_array))
+		KEEP (*(SORT(.fini_array.*)))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.ctors : {
 		/* gcc uses crtbegin.o to find the start of
 		   the constructors, so we make sure it is
@@ -264,8 +288,7 @@
 		KEEP (*(SORT(.ctors.*)))
 		KEEP (*(.ctors))
-
-		/*
-		 * BSP: Moved into .data from .dtors
-		 */
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.dtors : {
 		KEEP (*crtbegin.o(.dtors))
 		KEEP (*crtbegin?.o(.dtors))
@@ -273,108 +296,127 @@
 		KEEP (*(SORT(.dtors.*)))
 		KEEP (*(.dtors))
-
-		/*
-		 * BSP: Moved into .data from .*
-		 */
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.data.rel.ro : {
+		*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
+		*(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.jcr : {
+		KEEP (*(.jcr))
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.dynamic : {
+		*(.dynamic)
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.got : {
+		*(.got.plt) *(.igot.plt) *(.got) *(.igot)
+		. = ALIGN (bsp_section_align);
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	.rodata : {
+		/* Special FreeBSD sysctl sections */
+		. = ALIGN (16);
+		__start_set_sysctl_set = .;
+		*(set_sysctl_*);
+		__stop_set_sysctl_set = ABSOLUTE(.);
+		*(set_domain_*);
+		*(set_pseudo_*);
+		_bsd__start_set_sysinit_set = .;
+		*(_bsd_set_sysinit_set);
+		_bsd__stop_set_sysinit_set = .;
+		_bsd__start_set_modmetadata_set = .;
+		*(_bsd_set_modmetadata_set);
+		_bsd__stop_set_modmetadata_set = .;
+		_bsd__start_set_sysctl_set = .;
+		*(_bsd_set_sysctl_set);
+		_bsd__stop_set_sysctl_set = .;
+
+		*(.rodata .rodata.* .gnu.linkonce.r.*)
+		. = ALIGN (bsp_section_align);
+		bsp_section_rodata_end = .;
+	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
+	bsp_section_rodata_load_begin = LOADADDR (.rodata1);
+	bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
+
+	.robarrier : {
+		. = ALIGN (bsp_section_robarrier_align);
+	} > REGION_RODATA
+
+	.data1 : {
+		bsp_section_data_begin = .;
 		*(.data1)
-		KEEP (*(.eh_frame))
-		*(.gcc_except_table .gcc_except_table.*)
-		KEEP (*(.jcr))
-
+		. = ALIGN (bsp_section_align);
+	} > REGION_DATA AT > REGION_DATA_LOAD
+	.data : {
 		*(.data .data.* .gnu.linkonce.d.*)
-		KEEP (*(.gnu.linkonce.d.*personality*))
 		SORT(CONSTRUCTORS)
-
-		. = ALIGN (bsp_section_data_end_align);
-
-		/*
-		 * BSP: End of data section
-		 */
+		. = ALIGN (bsp_section_align);
 		bsp_section_data_end = .;
 	} > REGION_DATA AT > REGION_DATA_LOAD
-
 	bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
-
-	bsp_section_data_load_begin = LOADADDR (.data);
-
-	.fast : {
-		bsp_section_fast_begin = .;
-
-		*(.bsp_fast)
-
-		. = ALIGN (bsp_section_fast_end_align);
-
-		bsp_section_fast_end = .;
+	bsp_section_data_load_begin = LOADADDR (.data1);
+	bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
+
+	.fast_text : {
+		bsp_section_fast_text_begin = .;
+		*(.bsp_fast_text)
+		. = ALIGN (bsp_section_align);
+		bsp_section_fast_text_end = .;
 	} > REGION_FAST AT > REGION_FAST_LOAD
-
-	bsp_section_fast_size = bsp_section_fast_end - bsp_section_fast_begin;
-
-	bsp_section_fast_load_begin = LOADADDR (.fast);
+	bsp_section_fast_text_size = bsp_section_fast_text_end - bsp_section_fast_text_begin;
+	bsp_section_fast_text_load_begin = LOADADDR (.fast_text);
+	bsp_section_fast_text_load_end = bsp_section_fast_text_load_begin + bsp_section_fast_text_size;
+
+	.fast_data : {
+		bsp_section_fast_data_begin = .;
+		*(.bsp_fast_data)
+		. = ALIGN (bsp_section_align);
+		bsp_section_fast_data_end = .;
+	} > REGION_FAST AT > REGION_FAST_LOAD
+	bsp_section_fast_data_size = bsp_section_fast_data_end - bsp_section_fast_data_begin;
+	bsp_section_fast_data_load_begin = LOADADDR (.fast_data);
+	bsp_section_fast_data_load_end = bsp_section_fast_data_load_begin + bsp_section_fast_data_size;
 
 	.bss : {
-		/*
-		 * BSP: Begin of bss section
-		 */
 		bsp_section_bss_begin = .;
-
-		*(COMMON)
 		*(.dynbss)
 		*(.bss .bss.* .gnu.linkonce.b.*)
-
-		. = ALIGN (bsp_section_bss_end_align);
-
-		/*
-		 * BSP: End of bss section
-		 */
+		*(COMMON)
+		. = ALIGN (bsp_section_align);
 		bsp_section_bss_end = .;
 	} > REGION_BSS AT > REGION_BSS
-
 	bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
 
 	.work : {
 		/*
-		 * BSP: Begin of work section.  The work section will occupy
-		 * the remaining REGION_WORK region and contains the RTEMS work
-		 * space and heap.
+		 * The work section will occupy the remaining REGION_WORK region and
+		 * contains the RTEMS work space and heap.
 		 */
 		bsp_section_work_begin = .;
-
 		. += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
-
-		/*
-		 * BSP: End of work section
-		 */
 		bsp_section_work_end = .;
 	} > REGION_WORK AT > REGION_WORK
-
 	bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
 
 	.stack : {
 		/*
-		 * BSP: Begin of stack section.  The stack section will occupy
-		 * the remaining REGION_STACK region and may contain the task
-		 * stacks.  Depending on the region distribution this section
-		 * may be of zero size.
+		 * The stack section will occupy the remaining REGION_STACK region and may
+		 * contain the task stacks.  Depending on the region distribution this
+		 * section may be of zero size.
 		 */
 		bsp_section_stack_begin = .;
-
 		. += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
-
-		/*
-		 * BSP: End of stack section
-		 */
 		bsp_section_stack_end = .;
 	} > REGION_STACK AT > REGION_STACK
-
 	bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_begin;
 
-	/*
-	 * BSP: External symbols (FIXME)
-	 */
+	/* FIXME */
 	RamBase = ORIGIN (REGION_WORK);
 	RamSize = LENGTH (REGION_WORK);
 	WorkAreaBase = bsp_section_work_begin;
 	HeapSize = 0;
-	
+
 	/* Stabs debugging sections.  */
 	.stab          0 : { *(.stab) }
@@ -413,15 +455,9 @@
 	.debug_pubtypes 0 : { *(.debug_pubtypes) }
 	.debug_ranges   0 : { *(.debug_ranges) }
-	.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
-
-	/DISCARD/ : {
-		*(.note.GNU-stack) *(.gnu_debuglink)
-	}
-
-	/*
-	 * BSP: Catch all unknown sections
-	 */
-	.nirvana : {
-		*(*)
-	} > NIRVANA
+	.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
+	.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
+	/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+
+	/* Catch all unknown sections */
+	.nirvana : { *(*) } > NIRVANA
 }
