The architecture may provide custom versions of certain standard header files:
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 0bb531d67a..9714b0228c 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -628,7 +628,7 @@ defconfig -- This is a configuration file similar to the Linux
function by Daniel Vik. See licensing information in the top-level
COPYING file. Default: n
- And if CONFIG_MEMCPY_VIK, the following tuning options are available:
+ And if CONFIG_MEMCPY_VIK is selected, the following tuning options are available:
CONFIG_MEMCPY_PRE_INC_PTRS - Use pre-increment of pointers. Default is
post increment of pointers.
@@ -644,6 +644,11 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_MEMSET_OPTSPEED - Select this option to use a version of memcpy()
optimized for speed. Default: memcpy() is optimized for size.
+ And if CONFIG_MEMSET_OPTSPEED is selected, the following tuning option is
+ available:
+
+ CONFIG_MEMSET_64BIT - Compiles memset() for 64 bit architectures
+
The architecture may provide custom versions of certain standard header
files:
diff --git a/nuttx/lib/Kconfig b/nuttx/lib/Kconfig
index 0f25c89238..80c584ce92 100644
--- a/nuttx/lib/Kconfig
+++ b/nuttx/lib/Kconfig
@@ -219,6 +219,13 @@ config MEMSET_OPTSPEED
Select this option to use a version of memcpy() optimized for speed.
Default: memcpy() is optimized for size.
+config MEMSET_64BIT
+ bool "64-bit memset()"
+ default n
+ depends on MEMSET_OPTSPEED
+ ---help---
+ Compiles memset() for 64 bit architectures
+
config ARCH_STRCMP
bool "strcmp()"
default n
diff --git a/nuttx/lib/string/lib_memmove.c b/nuttx/lib/string/lib_memmove.c
index ecaeb54cf2..85cb79e174 100644
--- a/nuttx/lib/string/lib_memmove.c
+++ b/nuttx/lib/string/lib_memmove.c
@@ -56,17 +56,22 @@ void *memmove(void *dest, const void *src, size_t count)
if (dest <= src)
{
tmp = (char*) dest;
- s = (char*) src;
+ s = (char*) src;
while (count--)
- *tmp++ = *s++;
+ {
+ *tmp++ = *s++;
+ }
}
else
{
tmp = (char*) dest + count;
- s = (char*) src + count;
+ s = (char*) src + count;
while (count--)
- *--tmp = *--s;
+ {
+ *--tmp = *--s;
+ }
}
+
return dest;
}
#endif
diff --git a/nuttx/lib/string/lib_memset.c b/nuttx/lib/string/lib_memset.c
index c910d2ce04..2828f1ff86 100644
--- a/nuttx/lib/string/lib_memset.c
+++ b/nuttx/lib/string/lib_memset.c
@@ -1,4 +1,5 @@
-/************************************************************
+
+/****************************************************************************
* lib/string/lib_memset.c
*
* Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
@@ -31,15 +32,12 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
- * Compilation Switches
- ************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include
@@ -49,9 +47,21 @@
#include
#include
-/************************************************************
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Can't support CONFIG_MEMSET_64BIT if the platform does not have 64-bit
+ * integer types.
+ */
+
+#ifndef CONFIG_HAVE_LONG_LONG
+# undef CONFIG_MEMSET_64BIT
+#endif
+
+/****************************************************************************
* Global Functions
- ************************************************************/
+ ****************************************************************************/
#ifndef CONFIG_ARCH_MEMSET
void *memset(void *s, int c, size_t n)
@@ -59,13 +69,15 @@ void *memset(void *s, int c, size_t n)
#ifdef CONFIG_MEMSET_OPTSPEED
/* This version is optimized for speed (you could do better
* still by exploiting processor caching or memory burst
- * knowledge. 64-bit support might improve performance as
- * well.
+ * knowledge.)
*/
uintptr_t addr = (uintptr_t)s;
- uint16_t val16 = ((uint16_t)c << 8) | (uint16_t)c;
- uint32_t val32 = ((uint32_t)val16 << 16) | (uint32_t)val16;
+ uint16_t val16 = ((uint16_t)c << 8) | (uint16_t)c;
+ uint32_t val32 = ((uint32_t)val16 << 16) | (uint32_t)val16;
+#ifdef CONFIG_MEMSET_64BIT
+ uint64_t val64 = ((uint64_t)val32 << 32) | (uint64_t)val32;
+#endif
/* Make sure that there is something to be cleared */
@@ -95,6 +107,7 @@ void *memset(void *s, int c, size_t n)
n -= 2;
}
+#ifndef CONFIG_MEMSET_64BIT
/* Loop while there are at least 32-bits left to be zeroed */
while (n >= 4)
@@ -103,12 +116,51 @@ void *memset(void *s, int c, size_t n)
addr += 4;
n -= 4;
}
+#else
+ /* Align to a 32-bit boundary */
+
+ if (n >= 4)
+ {
+ /* Align to a 64-bit boundary (we know that the destination
+ * address is already aligned to at least a 32-bit boundary).
+ */
+
+ if ((addr & 7) != 0)
+ {
+ *(uint32_t*)addr = val32;
+ addr += 4;
+ n -= 4;
+ }
+
+ /* Loop while there are at least 64-bits left to be zeroed */
+
+ while (n >= 8)
+ {
+ *(uint64_t*)addr = val64;
+ addr += 8;
+ n -= 8;
+ }
+ }
+#endif
}
+#ifdef CONFIG_MEMSET_64BIT
+ /* We may get here with n in the range 0..7. If n >= 4, then we should
+ * have 64-bit alignment.
+ */
+
+ if (n >= 4)
+ {
+ *(uint32_t*)addr = val32;
+ addr += 4;
+ n -= 4;
+ }
+#endif
+
/* We may get here under the following conditions:
*
* n = 0, addr may or may not be aligned
- * n = 1, addr may or may not be aligned
+ * n = 1, addr is aligned to at least a 16-bit boundary
* n = 2, addr is aligned to a 32-bit boundary
* n = 3, addr is aligned to a 32-bit boundary
*/
From d59b634a70f7c02b7db95ef1ccbc5030ec280d7c Mon Sep 17 00:00:00 2001
From: patacongo
Date: Sun, 21 Oct 2012 01:34:37 +0000
Subject: [PATCH 013/206] Optimized memset() can be configured to do 64-bit
stores
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5244 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/lib/string/lib_memset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nuttx/lib/string/lib_memset.c b/nuttx/lib/string/lib_memset.c
index 2828f1ff86..902a040c58 100644
--- a/nuttx/lib/string/lib_memset.c
+++ b/nuttx/lib/string/lib_memset.c
@@ -117,7 +117,7 @@ void *memset(void *s, int c, size_t n)
n -= 4;
}
#else
- /* Align to a 32-bit boundary */
+ /* Check if there are at least 32-bits left to be zeroed */
if (n >= 4)
{
From 479687966353b92216e1d3eaf35f83a2b4660f21 Mon Sep 17 00:00:00 2001
From: patacongo
Date: Sun, 21 Oct 2012 05:38:24 +0000
Subject: [PATCH 014/206] Minor tweaks to memset
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5245 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/Documentation/NuttxPortingGuide.html | 1 +
nuttx/configs/README.txt | 11 +++--
nuttx/lib/Kconfig | 10 +++--
nuttx/lib/string/lib_memset.c | 49 ++++++++++------------
4 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 08c6534cb4..d8ccfc3404 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -4452,6 +4452,7 @@ build
-
CONFIG_MEMCPY_VIK
:
Select this option to use the optimized memcpy()
function by Daniel Vik.
+ Select this option for improved performance at the expense of increased size.
See licensing information in the top-level COPYING
file.
Default: n
.
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 9714b0228c..c7f3db0e7b 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -625,8 +625,9 @@ defconfig -- This is a configuration file similar to the Linux
Vik's optimized implementation of memcpy():
CONFIG_MEMCPY_VIK - Select this option to use the optimized memcpy()
- function by Daniel Vik. See licensing information in the top-level
- COPYING file. Default: n
+ function by Daniel Vik. Select this option for improved performance
+ at the expense of increased size. See licensing information in the
+ top-level COPYING file. Default: n
And if CONFIG_MEMCPY_VIK is selected, the following tuning options are available:
@@ -636,7 +637,8 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_MEMCPY_INDEXED_COPY - Copying data using array indexing. Using
this option, disables the CONFIG_MEMCPY_PRE_INC_PTRS option.
- CONFIG_MEMCPY_64BIT - Compiles memcpy for 64 bit architectures
+ CONFIG_MEMCPY_64BIT - Compiles memcpy for architectures that suppport
+ 64-bit operations efficiently.
If CONFIG_ARCH_MEMSET is not selected, then the following option is
also available:
@@ -647,7 +649,8 @@ defconfig -- This is a configuration file similar to the Linux
And if CONFIG_MEMSET_OPTSPEED is selected, the following tuning option is
available:
- CONFIG_MEMSET_64BIT - Compiles memset() for 64 bit architectures
+ CONFIG_MEMSET_64BIT - Compiles memset() for architectures that suppport
+ 64-bit operations efficiently.
The architecture may provide custom versions of certain standard header
files:
diff --git a/nuttx/lib/Kconfig b/nuttx/lib/Kconfig
index 80c584ce92..ddd5e2dde5 100644
--- a/nuttx/lib/Kconfig
+++ b/nuttx/lib/Kconfig
@@ -165,8 +165,8 @@ config MEMCPY_VIK
depends on !ARCH_MEMCPY
---help---
Select this option to use the optimized memcpy() function by Daniel Vik.
- Select this option to option for speed at the expense of increased size.
- See licensing information in the top-level COPYING file.
+ Select this option for improved performance at the expense of increased
+ size. See licensing information in the top-level COPYING file.
if MEMCPY_VIK
config MEMCPY_PRE_INC_PTRS
@@ -186,7 +186,8 @@ config MEMCPY_64BIT
bool "64-bit memcpy()"
default n
---help---
- Compiles memcpy() for 64 bit architectures
+ Compiles memcpy() for architectures that suppport 64-bit operations
+ efficiently.
endif
@@ -224,7 +225,8 @@ config MEMSET_64BIT
default n
depends on MEMSET_OPTSPEED
---help---
- Compiles memset() for 64 bit architectures
+ Compiles memset() for architectures that suppport 64-bit operations
+ efficiently.
config ARCH_STRCMP
bool "strcmp()"
diff --git a/nuttx/lib/string/lib_memset.c b/nuttx/lib/string/lib_memset.c
index 902a040c58..31c386e928 100644
--- a/nuttx/lib/string/lib_memset.c
+++ b/nuttx/lib/string/lib_memset.c
@@ -92,7 +92,7 @@ void *memset(void *s, int c, size_t n)
n -= 1;
}
- /* Check if there are at least 16-bits left to be zeroed */
+ /* Check if there are at least 16-bits left to be written */
if (n >= 2)
{
@@ -108,7 +108,7 @@ void *memset(void *s, int c, size_t n)
}
#ifndef CONFIG_MEMSET_64BIT
- /* Loop while there are at least 32-bits left to be zeroed */
+ /* Loop while there are at least 32-bits left to be written */
while (n >= 4)
{
@@ -117,7 +117,7 @@ void *memset(void *s, int c, size_t n)
n -= 4;
}
#else
- /* Check if there are at least 32-bits left to be zeroed */
+ /* Check if there are at least 32-bits left to be written */
if (n >= 4)
{
@@ -132,7 +132,7 @@ void *memset(void *s, int c, size_t n)
n -= 4;
}
- /* Loop while there are at least 64-bits left to be zeroed */
+ /* Loop while there are at least 64-bits left to be written */
while (n >= 8)
{
@@ -145,16 +145,16 @@ void *memset(void *s, int c, size_t n)
}
#ifdef CONFIG_MEMSET_64BIT
- /* We may get here with n in the range 0..7. If n >= 4, then we should
- * have 64-bit alignment.
- */
+ /* We may get here with n in the range 0..7. If n >= 4, then we should
+ * have 64-bit alignment.
+ */
- if (n >= 4)
- {
- *(uint32_t*)addr = val32;
- addr += 4;
- n -= 4;
- }
+ if (n >= 4)
+ {
+ *(uint32_t*)addr = val32;
+ addr += 4;
+ n -= 4;
+ }
#endif
/* We may get here under the following conditions:
@@ -165,23 +165,16 @@ void *memset(void *s, int c, size_t n)
* n = 3, addr is aligned to a 32-bit boundary
*/
- switch (n)
+ if (n >= 2)
{
- default:
- case 0:
- DEBUGASSERT(n == 0);
- break;
+ *(uint16_t*)addr = val16;
+ addr += 2;
+ n -= 2;
+ }
- case 2:
- *(uint16_t*)addr = val16;
- break;
-
- case 3:
- *(uint16_t*)addr = val16;
- addr += 2;
- case 1:
- *(uint8_t*)addr = (uint8_t)c;
- break;
+ if (n >= 1)
+ {
+ *(uint8_t*)addr = (uint8_t)c;
}
}
#else
From 6ea7967d8acf16b2cc2849929faf63f902b208ef Mon Sep 17 00:00:00 2001
From: patacongo
Date: Sun, 21 Oct 2012 15:47:34 +0000
Subject: [PATCH 015/206] Kconfig changes to get a clean STM32 ADC example
build
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5246 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/Kconfig | 28 +++++++--
nuttx/arch/arm/src/stm32/Kconfig | 90 +++++++++++++++++++++++++++++
nuttx/configs/shenzhou/README.txt | 28 +++++++++
nuttx/configs/shenzhou/src/up_adc.c | 13 ++++-
nuttx/lib/string/Make.defs | 2 +-
5 files changed, 154 insertions(+), 7 deletions(-)
diff --git a/nuttx/Kconfig b/nuttx/Kconfig
index 0fe6eb0f7c..325759b41a 100644
--- a/nuttx/Kconfig
+++ b/nuttx/Kconfig
@@ -244,17 +244,24 @@ config DEBUG_ENABLE
comment "Subsystem Debug Options"
+config DEBUG_MM
+ bool "Enable Memory Manager Debug Output"
+ default n
+ ---help---
+ Enable memory management debug output (disabled by default)
+
config DEBUG_SCHED
bool "Enable Scheduler Debug Output"
default n
---help---
Enable OS debug output (disabled by default)
-config DEBUG_MM
- bool "Enable Memory Manager Debug Output"
+config DEBUG_PAGING
+ bool "Enable Demand Paging Debug Output"
default n
+ depends on PAGING
---help---
- Enable memory management debug output (disabled by default)
+ Enable demand paging debug output (disabled by default)
config DEBUG_NET
bool "Enable Network Debug Output"
@@ -311,6 +318,13 @@ config DEBUG_INPUT
Enable low level debug output from the input device drivers such as
mice and touchscreens (disabled by default)
+config DEBUG_ANALOG
+ bool "Enable Analog Device Debug Output"
+ default n
+ ---help---
+ Enable low level debug output from the analog device drivers such as
+ A/D and D/A converters (disabled by default)
+
config DEBUG_I2C
bool "Enable I2C Debug Output"
default n
@@ -325,12 +339,18 @@ config DEBUG_SPI
---help---
Enable I2C driver debug output (disabled by default)
+config DEBUG_DMA
+ bool "Enable DMA Debug Output"
+ default n
+ ---help---
+ Enable DMA-releated debug output (disabled by default)
+
config DEBUG_WATCHDOG
bool "Enable Watchdog Timer Debug Output"
default n
depends on WATCHDOG
---help---
- Enable watchdog timer debug output (disabled by default)
+ Enable watchdog timer debug output (disabled by default)
endif
diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig
index 2f91002360..c9482b6d65 100644
--- a/nuttx/arch/arm/src/stm32/Kconfig
+++ b/nuttx/arch/arm/src/stm32/Kconfig
@@ -909,16 +909,22 @@ choice
config STM32_TIM1_ADC1
bool "TIM1 ADC channel 1"
+ depends on STM32_ADC1
+ select HAVE_ADC1_TIMER
---help---
Reserve TIM1 to trigger ADC1
config STM32_TIM1_ADC2
bool "TIM1 ADC channel 2"
+ depends on STM32_ADC2
+ select HAVE_ADC2_TIMER
---help---
Reserve TIM1 to trigger ADC2
config STM32_TIM1_ADC3
bool "TIM1 ADC channel 3"
+ depends on STM32_ADC3
+ select HAVE_ADC3_TIMER
---help---
Reserve TIM1 to trigger ADC3
@@ -945,16 +951,22 @@ choice
config STM32_TIM2_ADC1
bool "TIM2 ADC channel 1"
+ depends on STM32_ADC1
+ select HAVE_ADC1_TIMER
---help---
Reserve TIM2 to trigger ADC1
config STM32_TIM2_ADC2
bool "TIM2 ADC channel 2"
+ depends on STM32_ADC2
+ select HAVE_ADC2_TIMER
---help---
Reserve TIM2 to trigger ADC2
config STM32_TIM2_ADC3
bool "TIM2 ADC channel 3"
+ depends on STM32_ADC3
+ select HAVE_ADC3_TIMER
---help---
Reserve TIM2 to trigger ADC3
@@ -981,16 +993,22 @@ choice
config STM32_TIM3_ADC1
bool "TIM3 ADC channel 1"
+ depends on STM32_ADC1
+ select HAVE_ADC1_TIMER
---help---
Reserve TIM3 to trigger ADC1
config STM32_TIM3_ADC2
bool "TIM3 ADC channel 2"
+ depends on STM32_ADC2
+ select HAVE_ADC2_TIMER
---help---
Reserve TIM3 to trigger ADC2
config STM32_TIM3_ADC3
bool "TIM3 ADC channel 3"
+ depends on STM32_ADC3
+ select HAVE_ADC3_TIMER
---help---
Reserve TIM3 to trigger ADC3
@@ -1017,16 +1035,22 @@ choice
config STM32_TIM4_ADC1
bool "TIM4 ADC channel 1"
+ depends on STM32_ADC1
+ select HAVE_ADC1_TIMER
---help---
Reserve TIM4 to trigger ADC1
config STM32_TIM4_ADC2
bool "TIM4 ADC channel 2"
+ depends on STM32_ADC2
+ select HAVE_ADC2_TIMER
---help---
Reserve TIM4 to trigger ADC2
config STM32_TIM4_ADC3
bool "TIM4 ADC channel 3"
+ depends on STM32_ADC3
+ select HAVE_ADC3_TIMER
---help---
Reserve TIM4 to trigger ADC3
@@ -1053,16 +1077,22 @@ choice
config STM32_TIM5_ADC1
bool "TIM5 ADC channel 1"
+ depends on STM32_ADC1
+ select HAVE_ADC1_TIMER
---help---
Reserve TIM5 to trigger ADC1
config STM32_TIM5_ADC2
bool "TIM5 ADC channel 2"
+ depends on STM32_ADC2
+ select HAVE_ADC2_TIMER
---help---
Reserve TIM5 to trigger ADC2
config STM32_TIM5_ADC3
bool "TIM5 ADC channel 3"
+ depends on STM32_ADC3
+ select HAVE_ADC3_TIMER
---help---
Reserve TIM5 to trigger ADC3
@@ -1089,21 +1119,81 @@ choice
config STM32_TIM8_ADC1
bool "TIM8 ADC channel 1"
+ depends on STM32_ADC1
+ select HAVE_ADC1_TIMER
---help---
Reserve TIM8 to trigger ADC1
config STM32_TIM8_ADC2
bool "TIM8 ADC channel 2"
+ depends on STM32_ADC2
+ select HAVE_ADC2_TIMER
---help---
Reserve TIM8 to trigger ADC2
config STM32_TIM8_ADC3
bool "TIM8 ADC channel 3"
+ depends on STM32_ADC3
+ select HAVE_ADC3_TIMER
---help---
Reserve TIM8 to trigger ADC3
endchoice
+config HAVE_ADC1_TIMER
+ bool
+
+config HAVE_ADC2_TIMER
+ bool
+
+config HAVE_ADC3_TIMER
+ bool
+
+config STM32_ADC1_SAMPLE_FREQUENCY
+ int "ADC1 Sampling Frequency"
+ default 100
+ depends on HAVE_ADC1_TIMER
+ ---help---
+ ADC1 sampling frequency. Default: 100Hz
+
+config STM32_ADC1_TIMTRIG
+ int "ADC1 Timer Trigger"
+ default 0
+ range 0 4
+ depends on HAVE_ADC1_TIMER
+ ---help---
+ Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
+
+config STM32_ADC2_SAMPLE_FREQUENCY
+ int "ADC2 Sampling Frequency"
+ default 100
+ depends on HAVE_ADC2_TIMER
+ ---help---
+ ADC2 sampling frequency. Default: 100Hz
+
+config STM32_ADC2_TIMTRIG
+ int "ADC2 Timer Trigger"
+ default 0
+ range 0 4
+ depends on HAVE_ADC2_TIMER
+ ---help---
+ Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
+
+config STM32_ADC3_SAMPLE_FREQUENCY
+ int "ADC3 Sampling Frequency"
+ default 100
+ depends on HAVE_ADC3_TIMER
+ ---help---
+ ADC3 sampling frequency. Default: 100Hz
+
+config STM32_ADC3_TIMTRIG
+ int "ADC3 Timer Trigger"
+ default 0
+ range 0 4
+ depends on HAVE_ADC3_TIMER
+ ---help---
+ Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
+
config STM32_TIM1_DAC
bool "TIM1 DAC"
default n
diff --git a/nuttx/configs/shenzhou/README.txt b/nuttx/configs/shenzhou/README.txt
index 7bf67710da..a60019a279 100644
--- a/nuttx/configs/shenzhou/README.txt
+++ b/nuttx/configs/shenzhou/README.txt
@@ -772,6 +772,34 @@ Where is one of the following:
before the networking finally gives up and decides that no network is
available.
+ 2. Enabling the ADC example:
+
+ The only internal signal for ADC testing is the potentiometer input:
+
+ ADC1_IN10(PC0) Potentiometer
+
+ External signals are also available on CON5 CN14:
+
+ ADC_IN8 (PB0) CON5 CN14 Pin2
+ ADC_IN9 (PB1) CON5 CN14 Pin1
+
+ The signal selection is hard-coded in configs/shenzhou/src/up_adc.c: The
+ potentiometer input (only) is selected.
+
+ These selections will enable sampling the potentiometer input at 100Hz using
+ Timer 1:
+
+ CONFIG_ANALOG=y : Enable analog device support
+ CONFIG_ADC=y : Enable generic ADC driver support
+ CONFIG_ADC_DMA=n : ADC DMA is not supported
+ CONFIG_STM32_ADC1=y : Enable ADC 1
+ CONFIG_STM32_TIM1=y : Enable Timer 1
+ CONFIG_STM32_TIM1_ADC=y : Use Timer 1 for ADC
+ CONFIG_STM32_TIM1_ADC1=y : Allocate Timer 1 to ADC 1
+ CONFIG_STM32_ADC1_SAMPLE_FREQUENCY=100 : Set sampling frequency to 100Hz
+ CONFIG_STM32_ADC1_TIMTRIG=0 : Trigger on timer output 0
+ CONFIG_EXAMPLES_ADC=y : Enable the apps/examples/adc built-in
+
nxwm
----
This is a special configuration setup for the NxWM window manager
diff --git a/nuttx/configs/shenzhou/src/up_adc.c b/nuttx/configs/shenzhou/src/up_adc.c
index fb20c6940a..e62289ca64 100644
--- a/nuttx/configs/shenzhou/src/up_adc.c
+++ b/nuttx/configs/shenzhou/src/up_adc.c
@@ -85,12 +85,21 @@
* Private Data
************************************************************************************/
-/* Identifying number of each ADC channel: Variable Resistor */
+/* Identifying number of each ADC channel. The only internal signal for ADC testing
+ * is the potentiometer input:
+ *
+ * ADC1_IN10(PC0) Potentiometer
+ *
+ * External signals are also available on CON5 CN14:
+ *
+ * ADC_IN8 (PB0) CON5 CN14 Pin2
+ * ADC_IN9 (PB1) CON5 CN14 Pin1
+ */
#ifdef CONFIG_STM32_ADC1
static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; //{10, 8, 9};
-/* Configurations of pins used byte each ADC channels */
+/* Configurations of pins used by each ADC channel */
static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC12_IN10}; //{GPIO_ADC12_IN10, GPIO_ADC12_IN8, GPIO_ADC12_IN9};
#endif
diff --git a/nuttx/lib/string/Make.defs b/nuttx/lib/string/Make.defs
index 16add6e89e..191b9ffea5 100644
--- a/nuttx/lib/string/Make.defs
+++ b/nuttx/lib/string/Make.defs
@@ -48,7 +48,7 @@ ifneq ($(CONFIG_ARCH_MEMCPY),y)
ifeq ($(CONFIG_MEMCPY_VIK),y)
CSRCS += lib_vikmemcpy.c
else
-CSRCS += lib_memccpy.c
+CSRCS += lib_memcpy.c
endif
endif
From 096397d49fbae5398528a1a8c0d84e091625249a Mon Sep 17 00:00:00 2001
From: patacongo
Date: Sun, 21 Oct 2012 16:53:38 +0000
Subject: [PATCH 016/206] STM32 ADC driver fixes
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5247 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/ChangeLog | 5 +++++
nuttx/arch/arm/src/stm32/stm32_adc.c | 10 +++++++---
nuttx/arch/arm/src/stm32/stm32_adc.h | 2 +-
nuttx/configs/shenzhou/README.txt | 7 +++++++
nuttx/drivers/analog/adc.c | 15 +++++++++++++--
5 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 44f38ee10a..f9e1bf5d03 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3496,3 +3496,8 @@
optimized for size.
* lib/strings/lib_memset.c: CONFIG_MEMSET_64BIT will perform 64-bit
aligned memset() operations.
+ * arch/arm/src/stm32/stm32_adc.c: Need to put the ADC back into the
+ initial reset in the open/setup logic. Opening the ADC driver works
+ the first time, but not the second because the device is left in a
+ powered down state on the last close.
+
diff --git a/nuttx/arch/arm/src/stm32/stm32_adc.c b/nuttx/arch/arm/src/stm32/stm32_adc.c
index 777f624aa4..b5033b0576 100644
--- a/nuttx/arch/arm/src/stm32/stm32_adc.c
+++ b/nuttx/arch/arm/src/stm32/stm32_adc.c
@@ -694,10 +694,10 @@ static int adc_timinit(FAR struct stm32_dev_s *priv)
case 4: /* TimerX TRGO event */
{
-#warning "TRGO support not yet implemented"
-
+ /* TODO: TRGO support not yet implemented */
/* Set the event TRGO */
+ ccenable = 0;
egr = GTIM_EGR_TG;
/* Set the duty cycle by writing to the CCR register for this channel */
@@ -971,7 +971,7 @@ static void adc_reset(FAR struct adc_dev_s *dev)
avdbg("intf: ADC%d\n", priv->intf);
flags = irqsave();
- /* Enable ADC reset state */
+ /* Enable ADC reset state */
adc_rccreset(priv, true);
@@ -1164,6 +1164,10 @@ static int adc_setup(FAR struct adc_dev_s *dev)
ret = irq_attach(priv->irq, priv->isr);
if (ret == OK)
{
+ /* Make sure that the ADC device is in the powered up, reset state */
+
+ adc_reset(dev);
+
/* Enable the ADC interrupt */
avdbg("Enable the ADC interrupt: irq=%d\n", priv->irq);
diff --git a/nuttx/arch/arm/src/stm32/stm32_adc.h b/nuttx/arch/arm/src/stm32/stm32_adc.h
index 34f29020c7..060fcdfb90 100644
--- a/nuttx/arch/arm/src/stm32/stm32_adc.h
+++ b/nuttx/arch/arm/src/stm32/stm32_adc.h
@@ -287,7 +287,7 @@
#if defined(ADC1_HAVE_TIMER) || defined(ADC2_HAVE_TIMER) || defined(ADC3_HAVE_TIMER)
# define ADC_HAVE_TIMER 1
-# if defined(CONFIG_STM32_STM32F10XX) && defined(CONFIG_STM32_FORCEPOWER)
+# if defined(CONFIG_STM32_STM32F10XX) && !defined(CONFIG_STM32_FORCEPOWER)
# warning "CONFIG_STM32_FORCEPOWER must be defined to enable the timer(s)"
# endif
#else
diff --git a/nuttx/configs/shenzhou/README.txt b/nuttx/configs/shenzhou/README.txt
index a60019a279..48f183aee4 100644
--- a/nuttx/configs/shenzhou/README.txt
+++ b/nuttx/configs/shenzhou/README.txt
@@ -593,6 +593,12 @@ Shenzhou-specific Configuration Options
CONFIG_STM32_ADC1
CONFIG_STM32_ADC2
+ Timer and I2C devices may need to the following to force power to be applied
+ unconditionally at power up. (Otherwise, the device is powered when it is
+ initialized).
+
+ CONFIG_STM32_FORCEPOWER
+
Timer devices may be used for different purposes. One special purpose is
to generate modulated outputs for such things as motor control. If CONFIG_STM32_TIMn
is defined (as above) then the following may also be defined to indicate that
@@ -798,6 +804,7 @@ Where is one of the following:
CONFIG_STM32_TIM1_ADC1=y : Allocate Timer 1 to ADC 1
CONFIG_STM32_ADC1_SAMPLE_FREQUENCY=100 : Set sampling frequency to 100Hz
CONFIG_STM32_ADC1_TIMTRIG=0 : Trigger on timer output 0
+ CONFIG_STM32_FORCEPOWER=y : Apply power to TIM1 a boot up time
CONFIG_EXAMPLES_ADC=y : Enable the apps/examples/adc built-in
nxwm
diff --git a/nuttx/drivers/analog/adc.c b/nuttx/drivers/analog/adc.c
index 84070f162a..72f19452a4 100644
--- a/nuttx/drivers/analog/adc.c
+++ b/nuttx/drivers/analog/adc.c
@@ -143,7 +143,7 @@ static int adc_open(FAR struct file *filep)
dev->ad_recv.af_head = 0;
dev->ad_recv.af_tail = 0;
- /* Finally, Enable the CAN RX interrupt */
+ /* Finally, Enable the ADC RX interrupt */
dev->ad_ops->ao_rxint(dev, true);
@@ -151,9 +151,11 @@ static int adc_open(FAR struct file *filep)
dev->ad_ocount = tmp;
}
+
irqrestore(flags);
}
}
+
sem_post(&dev->ad_closesem);
}
return ret;
@@ -370,6 +372,10 @@ static int adc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* Public Functions
****************************************************************************/
+/****************************************************************************
+ * Name: adc_receive
+ ****************************************************************************/
+
int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch, int32_t data)
{
FAR struct adc_fifo_s *fifo = &dev->ad_recv;
@@ -390,7 +396,7 @@ int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch, int32_t data)
if (nexttail != fifo->af_head)
{
- /* Add the new, decoded CAN message at the tail of the FIFO */
+ /* Add the new, decoded ADC sample at the tail of the FIFO */
fifo->af_buffer[fifo->af_tail].am_channel = ch;
fifo->af_buffer[fifo->af_tail].am_data = data;
@@ -403,11 +409,16 @@ int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch, int32_t data)
{
sem_post(&fifo->af_sem);
}
+
err = OK;
}
return err;
}
+/****************************************************************************
+ * Name: adc_register
+ ****************************************************************************/
+
int adc_register(FAR const char *path, FAR struct adc_dev_s *dev)
{
/* Initialize the ADC device structure */
From 2327d0eedcef3de9a9aed8b48ea786c531070b5f Mon Sep 17 00:00:00 2001
From: patacongo
Date: Tue, 23 Oct 2012 15:51:45 +0000
Subject: [PATCH 017/206] Fewer shell invocations in apps/Makefile
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5248 42af7a65-404d-4744-a932-0658087f49c3
---
apps/ChangeLog.txt | 3 +++
apps/Makefile | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 02843d547a..79de56614c 100644
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -380,3 +380,6 @@
* apps/examples/nximage/nximage_main.c: Add a 5 second delay after the
NX logo is presented so that there is time for the image to be verified.
Suggested by Petteri Aimonen.
+i * apps/Makefile: Small change that reduces the number of shell invocations
+ by one (Mike Smith).
+
diff --git a/apps/Makefile b/apps/Makefile
index e407e2de87..be98dbbfe2 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -114,8 +114,9 @@ $(foreach BUILTIN, $(CONFIGURED_APPS), $(eval $(call ADD_BUILTIN,$(BUILTIN))))
# provided by the user (possibly as a symbolic link) to add libraries and
# applications to the standard build from the repository.
-INSTALLED_APPS += ${shell if [ -r external/Makefile ]; then echo "external"; fi}
-SUBDIRS += ${shell if [ -r external/Makefile ]; then echo "external"; fi}
+EXTERNAL_DIR := $(dir $(wildcard external/Makefile))
+INSTALLED_APPS += $(EXTERNAL_DIR)
+SUBDIRS += $(EXTERNAL_DIR)
# The final build target
From d30053952442a0dfefbea23de238a8077ad3463e Mon Sep 17 00:00:00 2001
From: patacongo
Date: Tue, 23 Oct 2012 19:53:03 +0000
Subject: [PATCH 018/206] Move ld.script files from configuration directories
to script/ directory
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5249 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/ChangeLog | 7 +-
nuttx/configs/hymini-stm32v/buttons/Make.defs | 6 +-
nuttx/configs/hymini-stm32v/buttons/ld.script | 112 ----------------
.../hymini-stm32v/buttons/ld.script.dfu | 111 ----------------
nuttx/configs/hymini-stm32v/nsh/Make.defs | 6 +-
nuttx/configs/hymini-stm32v/nsh/ld.script | 112 ----------------
nuttx/configs/hymini-stm32v/nsh/ld.script.dfu | 111 ----------------
nuttx/configs/hymini-stm32v/nsh2/Make.defs | 6 +-
nuttx/configs/hymini-stm32v/nsh2/ld.script | 112 ----------------
.../configs/hymini-stm32v/nsh2/ld.script.dfu | 111 ----------------
nuttx/configs/hymini-stm32v/nx/Make.defs | 6 +-
nuttx/configs/hymini-stm32v/nx/ld.script.dfu | 111 ----------------
nuttx/configs/hymini-stm32v/nxlines/Make.defs | 6 +-
nuttx/configs/hymini-stm32v/nxlines/ld.script | 112 ----------------
.../hymini-stm32v/nxlines/ld.script.dfu | 111 ----------------
.../{usbserial => scripts}/ld.script | 6 +-
.../{nx/ld.script => scripts/ld.script.dfu} | 13 +-
.../configs/hymini-stm32v/usbserial/Make.defs | 6 +-
.../hymini-stm32v/usbserial/ld.script.dfu | 111 ----------------
.../hymini-stm32v/usbstorage/Make.defs | 6 +-
.../hymini-stm32v/usbstorage/ld.script | 112 ----------------
.../hymini-stm32v/usbstorage/ld.script.dfu | 111 ----------------
.../configs/olimex-lpc1766stk/ftpc/Make.defs | 6 +-
.../configs/olimex-lpc1766stk/ftpc/ld.script | 109 ----------------
.../olimex-lpc1766stk/hidkbd/Make.defs | 6 +-
.../olimex-lpc1766stk/hidkbd/ld.script | 109 ----------------
.../olimex-lpc1766stk/nettest/Make.defs | 6 +-
.../olimex-lpc1766stk/nettest/ld.script | 109 ----------------
nuttx/configs/olimex-lpc1766stk/nsh/Make.defs | 6 +-
nuttx/configs/olimex-lpc1766stk/nx/Make.defs | 6 +-
nuttx/configs/olimex-lpc1766stk/nx/ld.script | 109 ----------------
.../olimex-lpc1766stk/ostest/Make.defs | 6 +-
.../olimex-lpc1766stk/ostest/ld.script | 109 ----------------
.../{nsh => scripts}/ld.script | 12 +-
.../olimex-lpc1766stk/slip-httpd/Make.defs | 6 +-
.../olimex-lpc1766stk/slip-httpd/ld.script | 109 ----------------
.../olimex-lpc1766stk/thttpd/Make.defs | 4 +-
.../olimex-lpc1766stk/thttpd/ld.script | 109 ----------------
.../olimex-lpc1766stk/usbserial/Make.defs | 6 +-
.../olimex-lpc1766stk/usbserial/ld.script | 109 ----------------
.../olimex-lpc1766stk/usbstorage/Make.defs | 6 +-
.../olimex-lpc1766stk/usbstorage/ld.script | 109 ----------------
.../configs/olimex-lpc1766stk/wlan/Make.defs | 6 +-
.../configs/olimex-lpc1766stk/wlan/ld.script | 109 ----------------
nuttx/configs/stm3220g-eval/dhcpd/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/nettest/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/nettest/ld.script | 121 ------------------
nuttx/configs/stm3220g-eval/nsh/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/nsh/ld.script | 121 ------------------
nuttx/configs/stm3220g-eval/nsh2/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/nsh2/ld.script | 121 ------------------
nuttx/configs/stm3220g-eval/nxwm/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/nxwm/ld.script | 121 ------------------
nuttx/configs/stm3220g-eval/ostest/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/ostest/ld.script | 120 -----------------
.../{dhcpd => scripts}/ld.script | 2 +-
nuttx/configs/stm3220g-eval/telnetd/Make.defs | 4 +-
nuttx/configs/stm3220g-eval/telnetd/ld.script | 121 ------------------
58 files changed, 90 insertions(+), 3236 deletions(-)
delete mode 100644 nuttx/configs/hymini-stm32v/buttons/ld.script
delete mode 100644 nuttx/configs/hymini-stm32v/buttons/ld.script.dfu
delete mode 100755 nuttx/configs/hymini-stm32v/nsh/ld.script
delete mode 100755 nuttx/configs/hymini-stm32v/nsh/ld.script.dfu
delete mode 100644 nuttx/configs/hymini-stm32v/nsh2/ld.script
delete mode 100644 nuttx/configs/hymini-stm32v/nsh2/ld.script.dfu
delete mode 100644 nuttx/configs/hymini-stm32v/nx/ld.script.dfu
delete mode 100644 nuttx/configs/hymini-stm32v/nxlines/ld.script
delete mode 100644 nuttx/configs/hymini-stm32v/nxlines/ld.script.dfu
rename nuttx/configs/hymini-stm32v/{usbserial => scripts}/ld.script (96%)
mode change 100755 => 100644
rename nuttx/configs/hymini-stm32v/{nx/ld.script => scripts/ld.script.dfu} (89%)
delete mode 100755 nuttx/configs/hymini-stm32v/usbserial/ld.script.dfu
delete mode 100755 nuttx/configs/hymini-stm32v/usbstorage/ld.script
delete mode 100755 nuttx/configs/hymini-stm32v/usbstorage/ld.script.dfu
delete mode 100755 nuttx/configs/olimex-lpc1766stk/ftpc/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/hidkbd/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/nettest/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/nx/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/ostest/ld.script
rename nuttx/configs/olimex-lpc1766stk/{nsh => scripts}/ld.script (93%)
delete mode 100755 nuttx/configs/olimex-lpc1766stk/slip-httpd/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/thttpd/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/usbserial/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/usbstorage/ld.script
delete mode 100755 nuttx/configs/olimex-lpc1766stk/wlan/ld.script
delete mode 100644 nuttx/configs/stm3220g-eval/nettest/ld.script
delete mode 100644 nuttx/configs/stm3220g-eval/nsh/ld.script
delete mode 100644 nuttx/configs/stm3220g-eval/nsh2/ld.script
delete mode 100644 nuttx/configs/stm3220g-eval/nxwm/ld.script
delete mode 100644 nuttx/configs/stm3220g-eval/ostest/ld.script
rename nuttx/configs/stm3220g-eval/{dhcpd => scripts}/ld.script (98%)
delete mode 100644 nuttx/configs/stm3220g-eval/telnetd/ld.script
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index f9e1bf5d03..1aa2d9f151 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3500,4 +3500,9 @@
initial reset in the open/setup logic. Opening the ADC driver works
the first time, but not the second because the device is left in a
powered down state on the last close.
-
+ * configs/olimex-lpc1766stck/scripts: Replace all of the identical
+ ld.script files with the common one in this directory.
+ * configs/stm3220g-eval/scripts: Replace all of the identical
+ ld.script files with the common one in this directory.
+ * configs/hymini-stm32v/scripts: Replace all of the identical
+ ld.script files with the common one in this directory.
diff --git a/nuttx/configs/hymini-stm32v/buttons/Make.defs b/nuttx/configs/hymini-stm32v/buttons/Make.defs
index efc29cb1dc..565729c1a1 100644
--- a/nuttx/configs/hymini-stm32v/buttons/Make.defs
+++ b/nuttx/configs/hymini-stm32v/buttons/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/buttons/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/buttons/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/buttons/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/buttons/ld.script b/nuttx/configs/hymini-stm32v/buttons/ld.script
deleted file mode 100644
index ef6968958c..0000000000
--- a/nuttx/configs/hymini-stm32v/buttons/ld.script
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/buttons/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103VCT6 has 256Kb of FLASH beginning at address 0x0800:0000 and
- * 48Kb of SRAM beginning at address 0x2000:0000. 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103V has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/buttons/ld.script.dfu b/nuttx/configs/hymini-stm32v/buttons/ld.script.dfu
deleted file mode 100644
index 5c839a0d87..0000000000
--- a/nuttx/configs/hymini-stm32v/buttons/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/buttons/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nsh/Make.defs b/nuttx/configs/hymini-stm32v/nsh/Make.defs
index cade80762c..285bbe40ab 100644
--- a/nuttx/configs/hymini-stm32v/nsh/Make.defs
+++ b/nuttx/configs/hymini-stm32v/nsh/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/nsh/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/nsh/ld.script b/nuttx/configs/hymini-stm32v/nsh/ld.script
deleted file mode 100755
index c09e716cb6..0000000000
--- a/nuttx/configs/hymini-stm32v/nsh/ld.script
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nsh/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nsh/ld.script.dfu b/nuttx/configs/hymini-stm32v/nsh/ld.script.dfu
deleted file mode 100755
index 5dfc51ad1e..0000000000
--- a/nuttx/configs/hymini-stm32v/nsh/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nsh/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nsh2/Make.defs b/nuttx/configs/hymini-stm32v/nsh2/Make.defs
index 269b4979ea..9ad8c2774a 100644
--- a/nuttx/configs/hymini-stm32v/nsh2/Make.defs
+++ b/nuttx/configs/hymini-stm32v/nsh2/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/nsh2/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh2/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh2/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/nsh2/ld.script b/nuttx/configs/hymini-stm32v/nsh2/ld.script
deleted file mode 100644
index 1b861e6b65..0000000000
--- a/nuttx/configs/hymini-stm32v/nsh2/ld.script
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nsh2/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103VCT6 has 256Kb of FLASH beginning at address 0x0800:0000 and
- * 48Kb of SRAM beginning at address 0x2000:0000. 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nsh2/ld.script.dfu b/nuttx/configs/hymini-stm32v/nsh2/ld.script.dfu
deleted file mode 100644
index a8d0839c1d..0000000000
--- a/nuttx/configs/hymini-stm32v/nsh2/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nsh2/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nx/Make.defs b/nuttx/configs/hymini-stm32v/nx/Make.defs
index fce4ec279b..84700e0828 100644
--- a/nuttx/configs/hymini-stm32v/nx/Make.defs
+++ b/nuttx/configs/hymini-stm32v/nx/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/nx/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nx/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nx/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/nx/ld.script.dfu b/nuttx/configs/hymini-stm32v/nx/ld.script.dfu
deleted file mode 100644
index bd995086f5..0000000000
--- a/nuttx/configs/hymini-stm32v/nx/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nx/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nxlines/Make.defs b/nuttx/configs/hymini-stm32v/nxlines/Make.defs
index 8943c4cb72..b9e8841f0a 100644
--- a/nuttx/configs/hymini-stm32v/nxlines/Make.defs
+++ b/nuttx/configs/hymini-stm32v/nxlines/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/nxlines/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -89,13 +89,13 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nxlines/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nxlines/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/nxlines/ld.script b/nuttx/configs/hymini-stm32v/nxlines/ld.script
deleted file mode 100644
index 4938ad5010..0000000000
--- a/nuttx/configs/hymini-stm32v/nxlines/ld.script
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nxlines/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103VCT6 has 256Kb of FLASH beginning at address 0x0800:0000 and
- * 48Kb of SRAM beginning at address 0x2000:0000. 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/nxlines/ld.script.dfu b/nuttx/configs/hymini-stm32v/nxlines/ld.script.dfu
deleted file mode 100644
index b64109da8e..0000000000
--- a/nuttx/configs/hymini-stm32v/nxlines/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/nxlines/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/usbserial/ld.script b/nuttx/configs/hymini-stm32v/scripts/ld.script
old mode 100755
new mode 100644
similarity index 96%
rename from nuttx/configs/hymini-stm32v/usbserial/ld.script
rename to nuttx/configs/hymini-stm32v/scripts/ld.script
index 8a83616146..cef391bf42
--- a/nuttx/configs/hymini-stm32v/usbserial/ld.script
+++ b/nuttx/configs/hymini-stm32v/scripts/ld.script
@@ -1,10 +1,10 @@
/****************************************************************************
- * configs/hymini-stm32v/usbserial/ld.script
+ * configs/hymini-stm32v/scripts/ld.script
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
* Laurent Latil
-
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
diff --git a/nuttx/configs/hymini-stm32v/nx/ld.script b/nuttx/configs/hymini-stm32v/scripts/ld.script.dfu
similarity index 89%
rename from nuttx/configs/hymini-stm32v/nx/ld.script
rename to nuttx/configs/hymini-stm32v/scripts/ld.script.dfu
index c4a12d2b94..1f51a9fc3f 100644
--- a/nuttx/configs/hymini-stm32v/nx/ld.script
+++ b/nuttx/configs/hymini-stm32v/scripts/ld.script.dfu
@@ -1,7 +1,7 @@
/****************************************************************************
- * configs/hymini-stm32v/nx/ld.script
+ * configs/hymini-stm32v/scripts/ld.script.dfu
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -34,15 +34,14 @@
****************************************************************************/
/* The STM32F103VCT6 has 256Kb of FLASH beginning at address 0x0800:0000 and
- * 48Kb of SRAM beginning at address 0x2000:0000. 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.
+ * 48Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
+ * Hy-Mini STM32v's DFU bootloader is being used. In that case, the correct
+ * load .text load address is 0x08003000 (leaving 244Kb).
*/
MEMORY
{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 256K
+ flash (rx) : ORIGIN = 0x08003000, LENGTH = 244K
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
}
diff --git a/nuttx/configs/hymini-stm32v/usbserial/Make.defs b/nuttx/configs/hymini-stm32v/usbserial/Make.defs
index 1e8c90b123..559af81de5 100644
--- a/nuttx/configs/hymini-stm32v/usbserial/Make.defs
+++ b/nuttx/configs/hymini-stm32v/usbserial/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/usbserial/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/usbserial/ld.script.dfu b/nuttx/configs/hymini-stm32v/usbserial/ld.script.dfu
deleted file mode 100755
index 5734ed2675..0000000000
--- a/nuttx/configs/hymini-stm32v/usbserial/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/usbserial/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/usbstorage/Make.defs b/nuttx/configs/hymini-stm32v/usbstorage/Make.defs
index 8acc8db4aa..5fef4f705d 100644
--- a/nuttx/configs/hymini-stm32v/usbstorage/Make.defs
+++ b/nuttx/configs/hymini-stm32v/usbstorage/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/hymini-stm32v/usbstorage/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/hymini-stm32v/usbstorage/ld.script b/nuttx/configs/hymini-stm32v/usbstorage/ld.script
deleted file mode 100755
index 7e92fec83b..0000000000
--- a/nuttx/configs/hymini-stm32v/usbstorage/ld.script
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/usbstorage/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/hymini-stm32v/usbstorage/ld.script.dfu b/nuttx/configs/hymini-stm32v/usbstorage/ld.script.dfu
deleted file mode 100755
index 7bb2997c25..0000000000
--- a/nuttx/configs/hymini-stm32v/usbstorage/ld.script.dfu
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * configs/hymini-stm32v/usbstorage/ld.script.dfu
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103ZET6 has 512Kb of FLASH beginning at address 0x0800:0000 and
- * 64Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * Hy-Mini STM32v's DFU bootloader is being used. In that case, the corrct
- * load .text load address is 0x08003000 (leaving 464Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08003000, LENGTH = 464K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs b/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs
index 352c031749..674ad76929 100644
--- a/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/ftpc/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ftpc/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ftpc/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/ftpc/ld.script b/nuttx/configs/olimex-lpc1766stk/ftpc/ld.script
deleted file mode 100755
index 59b80c9bd6..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/ftpc/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/ftpc/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs b/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs
index 017a79e7dc..3c68d370d0 100644
--- a/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/hidkbd/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/hidkbd/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/hidkbd/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/hidkbd/ld.script b/nuttx/configs/olimex-lpc1766stk/hidkbd/ld.script
deleted file mode 100755
index c6c97d402f..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/hidkbd/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/hidkbd/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs b/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs
index 652899c083..57f2b7a558 100644
--- a/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/nettest/Make.defs
#
-# Copyright (C) 2010 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nettest/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nettest/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/nettest/ld.script b/nuttx/configs/olimex-lpc1766stk/nettest/ld.script
deleted file mode 100755
index cc05746bad..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/nettest/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/nettest/ld.script
- *
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs b/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs
index b517fae43c..c9ecf51db7 100644
--- a/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/nsh/Make.defs
#
-# Copyright (C) 2010 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/nx/Make.defs b/nuttx/configs/olimex-lpc1766stk/nx/Make.defs
index 2d0d63b190..64c9814925 100644
--- a/nuttx/configs/olimex-lpc1766stk/nx/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/nx/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/nx/Make.defs
#
-# Copyright (C) 2010 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nx/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nx/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/nx/ld.script b/nuttx/configs/olimex-lpc1766stk/nx/ld.script
deleted file mode 100755
index a4ad7e35bb..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/nx/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/nx/ld.script
- *
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs b/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs
index 6883694a3f..2f33642bfc 100644
--- a/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/ostest/Make.defs
#
-# Copyright (C) 2010 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/ostest/ld.script b/nuttx/configs/olimex-lpc1766stk/ostest/ld.script
deleted file mode 100755
index 323f1ec1dc..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/ostest/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/ostest/ld.script
- *
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/nsh/ld.script b/nuttx/configs/olimex-lpc1766stk/scripts/ld.script
similarity index 93%
rename from nuttx/configs/olimex-lpc1766stk/nsh/ld.script
rename to nuttx/configs/olimex-lpc1766stk/scripts/ld.script
index 5f6adbecdb..76da776894 100755
--- a/nuttx/configs/olimex-lpc1766stk/nsh/ld.script
+++ b/nuttx/configs/olimex-lpc1766stk/scripts/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
- * configs/olimex-lpc1766stk/nsh/ld.script
+ * configs/olimex-lpc1766stk/scripts/ld.script
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -66,7 +66,7 @@ SECTIONS
_etext = ABSOLUTE(.);
} > flash
- _eronly = ABSOLUTE(.); /* See below */
+ _eronly = ABSOLUTE(.);
.data : {
_sdata = ABSOLUTE(.);
@@ -86,14 +86,16 @@ SECTIONS
} >sram
__exidx_end = ABSOLUTE(.);
- .bss : { /* BSS */
+ .bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
- /* Stabs debugging sections. */
+
+ /* Stabs debugging sections. */
+
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs b/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs
index 984d4e1874..fc49b69814 100644
--- a/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/slip-httpd/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/slip-httpd/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/slip-httpd/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/slip-httpd/ld.script b/nuttx/configs/olimex-lpc1766stk/slip-httpd/ld.script
deleted file mode 100755
index 43d2662c80..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/slip-httpd/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/slip-httpd/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs b/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs
index 39e5ed299e..bb4df618b2 100644
--- a/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/thttpd/ld.script b/nuttx/configs/olimex-lpc1766stk/thttpd/ld.script
deleted file mode 100755
index 9225b8da61..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/thttpd/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/thttpd/ld.script
- *
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs b/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs
index 1cedb01d72..b4716971df 100644
--- a/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/usbserial/Make.defs
#
-# Copyright (C) 2010 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/usbserial/ld.script b/nuttx/configs/olimex-lpc1766stk/usbserial/ld.script
deleted file mode 100755
index 26e03a20e1..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/usbserial/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/usbserial/ld.script
- *
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs b/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs
index f879340f14..ed338c8b26 100644
--- a/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/usbstorage/Make.defs
#
-# Copyright (C) 2010 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/usbstorage/ld.script b/nuttx/configs/olimex-lpc1766stk/usbstorage/ld.script
deleted file mode 100755
index 8c81ff85a1..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/usbstorage/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/usbstorage/ld.script
- *
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs b/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs
index a316a0e6a6..08f55feab7 100644
--- a/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs
+++ b/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/olimex-lpc1766stk/wlan/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -74,14 +74,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/wlan/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/wlan/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/olimex-lpc1766stk/wlan/ld.script b/nuttx/configs/olimex-lpc1766stk/wlan/ld.script
deleted file mode 100755
index 82fc20a440..0000000000
--- a/nuttx/configs/olimex-lpc1766stk/wlan/ld.script
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
- * configs/olimex-lpc1766stk/wlan/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.); /* See below */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : { /* BSS */
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/stm3220g-eval/dhcpd/Make.defs b/nuttx/configs/stm3220g-eval/dhcpd/Make.defs
index e8bb28c762..e5a0e7b06a 100644
--- a/nuttx/configs/stm3220g-eval/dhcpd/Make.defs
+++ b/nuttx/configs/stm3220g-eval/dhcpd/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/dhcpd/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/dhcpd/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/nettest/Make.defs b/nuttx/configs/stm3220g-eval/nettest/Make.defs
index 2c6b8a1f4e..2a8976d089 100644
--- a/nuttx/configs/stm3220g-eval/nettest/Make.defs
+++ b/nuttx/configs/stm3220g-eval/nettest/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nettest/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nettest/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/nettest/ld.script b/nuttx/configs/stm3220g-eval/nettest/ld.script
deleted file mode 100644
index 893ae1d662..0000000000
--- a/nuttx/configs/stm3220g-eval/nettest/ld.script
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
- * configs/stm3220g-eval/nettest/ld.script
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F207IGH6U has 1024Kb of FLASH beginning at address 0x0800:0000 and
- * 128Kb of SRAM. SRAM is split up into two blocks:
- *
- * 1) 112Kb of SRAM beginning at address 0x2000:0000
- * 2) 16Kb of SRAM beginning at address 0x2001:c000
- *
- * 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/stm3220g-eval/nsh/Make.defs b/nuttx/configs/stm3220g-eval/nsh/Make.defs
index 834db56bca..23a57ab800 100644
--- a/nuttx/configs/stm3220g-eval/nsh/Make.defs
+++ b/nuttx/configs/stm3220g-eval/nsh/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/nsh/ld.script b/nuttx/configs/stm3220g-eval/nsh/ld.script
deleted file mode 100644
index dfa2b3ccdd..0000000000
--- a/nuttx/configs/stm3220g-eval/nsh/ld.script
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
- * configs/stm3220g-eval/nsh/ld.script
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F207IGH6U has 1024Kb of FLASH beginning at address 0x0800:0000 and
- * 128Kb of SRAM. SRAM is split up into two blocks:
- *
- * 1) 112Kb of SRAM beginning at address 0x2000:0000
- * 2) 16Kb of SRAM beginning at address 0x2001:c000
- *
- * 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/stm3220g-eval/nsh2/Make.defs b/nuttx/configs/stm3220g-eval/nsh2/Make.defs
index f29c472148..38335c1709 100644
--- a/nuttx/configs/stm3220g-eval/nsh2/Make.defs
+++ b/nuttx/configs/stm3220g-eval/nsh2/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh2/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh2/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/nsh2/ld.script b/nuttx/configs/stm3220g-eval/nsh2/ld.script
deleted file mode 100644
index e03a33dcb2..0000000000
--- a/nuttx/configs/stm3220g-eval/nsh2/ld.script
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
- * configs/stm3220g-eval/nsh2/ld.script
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F207IGH6U has 1024Kb of FLASH beginning at address 0x0800:0000 and
- * 128Kb of SRAM. SRAM is split up into two blocks:
- *
- * 1) 112Kb of SRAM beginning at address 0x2000:0000
- * 2) 16Kb of SRAM beginning at address 0x2001:c000
- *
- * 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/stm3220g-eval/nxwm/Make.defs b/nuttx/configs/stm3220g-eval/nxwm/Make.defs
index 4b770ba64e..c4846c0c31 100644
--- a/nuttx/configs/stm3220g-eval/nxwm/Make.defs
+++ b/nuttx/configs/stm3220g-eval/nxwm/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nxwm/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nxwm/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/nxwm/ld.script b/nuttx/configs/stm3220g-eval/nxwm/ld.script
deleted file mode 100644
index 409ecc3af5..0000000000
--- a/nuttx/configs/stm3220g-eval/nxwm/ld.script
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
- * configs/stm3220g-eval/nxwm/ld.script
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F207IGH6U has 1024Kb of FLASH beginning at address 0x0800:0000 and
- * 128Kb of SRAM. SRAM is split up into two blocks:
- *
- * 1) 112Kb of SRAM beginning at address 0x2000:0000
- * 2) 16Kb of SRAM beginning at address 0x2001:c000
- *
- * 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/stm3220g-eval/ostest/Make.defs b/nuttx/configs/stm3220g-eval/ostest/Make.defs
index a67036f78a..e2de89cf74 100644
--- a/nuttx/configs/stm3220g-eval/ostest/Make.defs
+++ b/nuttx/configs/stm3220g-eval/ostest/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/ostest/ld.script b/nuttx/configs/stm3220g-eval/ostest/ld.script
deleted file mode 100644
index 17428ea857..0000000000
--- a/nuttx/configs/stm3220g-eval/ostest/ld.script
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
- * configs/stm3220g-eval/ostest/ld.script
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F207IGH6U has 1024Kb of FLASH two blocks:
- *
- * 1) 112Kb of SRAM beginning at address 0x2000:0000
- * 2) 16Kb of SRAM beginning at address 0x2001:c000
- *
- * 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/stm3220g-eval/dhcpd/ld.script b/nuttx/configs/stm3220g-eval/scripts/ld.script
similarity index 98%
rename from nuttx/configs/stm3220g-eval/dhcpd/ld.script
rename to nuttx/configs/stm3220g-eval/scripts/ld.script
index a264f2442d..1c9f12bba1 100644
--- a/nuttx/configs/stm3220g-eval/dhcpd/ld.script
+++ b/nuttx/configs/stm3220g-eval/scripts/ld.script
@@ -1,5 +1,5 @@
/****************************************************************************
- * configs/stm3220g-eval/dhcpd/ld.script
+ * configs/stm3220g-eval/scripts/ld.script
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
diff --git a/nuttx/configs/stm3220g-eval/telnetd/Make.defs b/nuttx/configs/stm3220g-eval/telnetd/Make.defs
index 4a69279062..4004508d50 100644
--- a/nuttx/configs/stm3220g-eval/telnetd/Make.defs
+++ b/nuttx/configs/stm3220g-eval/telnetd/Make.defs
@@ -110,14 +110,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/telnetd/$(LDSCRIPT)}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/telnetd/$(LDSCRIPT)
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/stm3220g-eval/telnetd/ld.script b/nuttx/configs/stm3220g-eval/telnetd/ld.script
deleted file mode 100644
index f4ecb084ac..0000000000
--- a/nuttx/configs/stm3220g-eval/telnetd/ld.script
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
- * configs/stm3220g-eval/telnetd/ld.script
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F207IGH6U has 1024Kb of FLASH beginning at address 0x0800:0000 and
- * 128Kb of SRAM. SRAM is split up into two blocks:
- *
- * 1) 112Kb of SRAM beginning at address 0x2000:0000
- * 2) 16Kb of SRAM beginning at address 0x2001:c000
- *
- * 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.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
From 1bd66e95f8b9817da320c85fc77ca6466bbdaed7 Mon Sep 17 00:00:00 2001
From: patacongo
Date: Wed, 24 Oct 2012 16:46:12 +0000
Subject: [PATCH 019/206] Add framework to support loadable ELF modules (not
much logic in place yet)
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5250 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/ChangeLog | 5 +
nuttx/Kconfig | 4 +
nuttx/binfmt/Kconfig | 34 +++
nuttx/binfmt/Makefile | 55 ++--
nuttx/binfmt/elf.c | 259 ++++++++++++++++++
nuttx/binfmt/libelf/Kconfig | 9 +
nuttx/binfmt/libelf/Make.defs | 53 ++++
nuttx/binfmt/libelf/gnu-elf.ld | 187 +++++++++++++
nuttx/binfmt/libelf/libelf_bind.c | 106 +++++++
nuttx/binfmt/libelf/libelf_init.c | 189 +++++++++++++
nuttx/binfmt/libelf/libelf_load.c | 91 ++++++
nuttx/binfmt/libelf/libelf_read.c | 165 +++++++++++
nuttx/binfmt/libelf/libelf_uninit.c | 85 ++++++
nuttx/binfmt/libelf/libelf_unload.c | 97 +++++++
nuttx/binfmt/libelf/libelf_verify.c | 88 ++++++
nuttx/binfmt/libnxflat/Kconfig | 5 +
nuttx/binfmt/libnxflat/Make.defs | 24 +-
nuttx/binfmt/libnxflat/libnxflat_bind.c | 46 ++--
nuttx/binfmt/libnxflat/libnxflat_uninit.c | 4 -
nuttx/binfmt/libnxflat/libnxflat_verify.c | 6 +-
.../lpcxpresso-lpc1768/dhcpd/Make.defs | 6 +-
.../configs/lpcxpresso-lpc1768/nsh/Make.defs | 6 +-
.../configs/lpcxpresso-lpc1768/nsh/ld.script | 110 --------
nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs | 6 +-
nuttx/configs/lpcxpresso-lpc1768/nx/ld.script | 110 --------
.../lpcxpresso-lpc1768/ostest/Make.defs | 6 +-
.../lpcxpresso-lpc1768/ostest/ld.script | 110 --------
.../{dhcpd => scripts}/ld.script | 7 +-
.../lpcxpresso-lpc1768/thttpd/Make.defs | 4 +-
.../lpcxpresso-lpc1768/thttpd/ld.script | 110 --------
.../lpcxpresso-lpc1768/usbstorage/Make.defs | 6 +-
.../lpcxpresso-lpc1768/usbstorage/ld.script | 110 --------
nuttx/include/elf.h | 53 ++++
nuttx/include/nuttx/elf.h | 259 ++++++++++++++++++
nuttx/include/nuttx/nxflat.h | 38 +--
35 files changed, 1802 insertions(+), 651 deletions(-)
create mode 100644 nuttx/binfmt/elf.c
create mode 100644 nuttx/binfmt/libelf/Kconfig
create mode 100644 nuttx/binfmt/libelf/Make.defs
create mode 100644 nuttx/binfmt/libelf/gnu-elf.ld
create mode 100644 nuttx/binfmt/libelf/libelf_bind.c
create mode 100644 nuttx/binfmt/libelf/libelf_init.c
create mode 100644 nuttx/binfmt/libelf/libelf_load.c
create mode 100644 nuttx/binfmt/libelf/libelf_read.c
create mode 100644 nuttx/binfmt/libelf/libelf_uninit.c
create mode 100644 nuttx/binfmt/libelf/libelf_unload.c
create mode 100644 nuttx/binfmt/libelf/libelf_verify.c
delete mode 100755 nuttx/configs/lpcxpresso-lpc1768/nsh/ld.script
delete mode 100755 nuttx/configs/lpcxpresso-lpc1768/nx/ld.script
delete mode 100755 nuttx/configs/lpcxpresso-lpc1768/ostest/ld.script
rename nuttx/configs/lpcxpresso-lpc1768/{dhcpd => scripts}/ld.script (95%)
delete mode 100755 nuttx/configs/lpcxpresso-lpc1768/thttpd/ld.script
delete mode 100755 nuttx/configs/lpcxpresso-lpc1768/usbstorage/ld.script
create mode 100644 nuttx/include/elf.h
create mode 100644 nuttx/include/nuttx/elf.h
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 1aa2d9f151..59fa735449 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3506,3 +3506,8 @@
ld.script files with the common one in this directory.
* configs/hymini-stm32v/scripts: Replace all of the identical
ld.script files with the common one in this directory.
+ * configs/lpcxpresso-lpc1768/scripts: Replace all of the identical
+ ld.script files with the common one in this directory.
+ * binfmt/elf.c, binfmt/libelf, include/elf.h, include/nuttx/elf.h: Add
+ basic framework for loadable ELF module support. The initial check-
+ in is non-functional and is simply the framework for ELF support.
diff --git a/nuttx/Kconfig b/nuttx/Kconfig
index 325759b41a..8239dec02d 100644
--- a/nuttx/Kconfig
+++ b/nuttx/Kconfig
@@ -395,6 +395,10 @@ menu "Memory Management"
source mm/Kconfig
endmenu
+menu "Binary Formats"
+source binfmt/Kconfig
+endmenu
+
menu "Library Routines"
source lib/Kconfig
source libxx/Kconfig
diff --git a/nuttx/binfmt/Kconfig b/nuttx/binfmt/Kconfig
index ae2bf31307..3519536fb6 100644
--- a/nuttx/binfmt/Kconfig
+++ b/nuttx/binfmt/Kconfig
@@ -2,3 +2,37 @@
# For a description of the syntax of this configuration file,
# see misc/tools/kconfig-language.txt.
#
+
+config BINFMT_DISABLE
+ bool "Disble BINFMT support"
+ default n
+ ---help---
+ By default, support for loadable binary formats is built. This logic
+ may be suppressed be defining this setting.
+
+if !BINFMT_DISABLE
+
+config NXFLAT
+ bool "Enable the NXFLAT Binary Format"
+ default n
+ ---help---
+ Enable support for the NXFLAT binary format. Default: n
+
+if NXFLAT
+include binfmt/libnxflat/Kconfig
+endif
+
+config ELF
+ bool "Enable the ELF Binary Format"
+ default n
+ ---help---
+ Enable support for the ELF binary format. Default: n
+
+if ELF
+include binfmt/libelf/Kconfig
+endif
+endif
+
+config SYMTAB_ORDEREDBYNAME
+ bool "Symbol Tables Ordered by Name"
+ default n
diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile
index b3a9269b30..1b98e3ede9 100644
--- a/nuttx/binfmt/Makefile
+++ b/nuttx/binfmt/Makefile
@@ -1,7 +1,7 @@
############################################################################
# nxflat/Makefile
#
-# Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
+# Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -36,55 +36,54 @@
-include $(TOPDIR)/Make.defs
ifeq ($(WINTOOL),y)
-INCDIROPT = -w
+INCDIROPT = -w
endif
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/sched}
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/sched}
-ifeq ($(CONFIG_NXFLAT),y)
-include libnxflat/Make.defs
-LIBNXFLAT_CSRCS += nxflat.c
-endif
+# Basic BINFMT source files
BINFMT_ASRCS =
BINFMT_CSRCS = binfmt_globals.c binfmt_register.c binfmt_unregister.c \
- binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c \
- binfmt_exec.c binfmt_dumpmodule.c
+ binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c \
+ binfmt_exec.c binfmt_dumpmodule.c
-SYMTAB_ASRCS =
-SYMTAB_CSRCS = symtab_findbyname.c symtab_findbyvalue.c \
- symtab_findorderedbyname.c symtab_findorderedbyvalue.c
+# Symbol table source files
-SUBDIRS = libnxflat
+BINFMT_CSRCS += symtab_findbyname.c symtab_findbyvalue.c \
+ symtab_findorderedbyname.c symtab_findorderedbyvalue.c
-ASRCS = $(BINFMT_ASRCS) $(SYMTAB_ASRCS) $(LIBNXFLAT_ASRCS)
-AOBJS = $(ASRCS:.S=$(OBJEXT))
+# Add configured binary modules
-CSRCS = $(BINFMT_CSRCS) $(SYMTAB_CSRCS) $(LIBNXFLAT_CSRCS)
-COBJS = $(CSRCS:.c=$(OBJEXT))
+VPATH =
+SUBDIRS =
-SRCS = $(ASRCS) $(CSRCS)
-OBJS = $(AOBJS) $(COBJS)
+include libnxflat/Make.defs
+include libelf/Make.defs
-BIN = libbinfmt$(LIBEXT)
+BINFMT_AOBJS = $(BINFMT_ASRCS:.S=$(OBJEXT))
+BINFMT_COBJS = $(BINFMT_CSRCS:.c=$(OBJEXT))
-VPATH = libnxflat
+BINFMT_SRCS = $(BINFMT_ASRCS) $(BINFMT_CSRCS)
+BINFMT_OBJS = $(BINFMT_AOBJS) $(BINFMT_COBJS)
-all: $(BIN)
+BIN = libbinfmt$(LIBEXT)
-$(AOBJS): %$(OBJEXT): %.S
+all: $(BIN)
+
+$(BINFMT_AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
-$(COBJS): %$(OBJEXT): %.c
+$(BINFMT_COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
-$(BIN): $(OBJS)
- @( for obj in $(OBJS) ; do \
+$(BIN): $(BINFMT_OBJS)
+ @( for obj in $(BINFMT_OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
-.depend: Makefile $(SRCS)
+.depend: Makefile $(BINFMT_SRCS)
@$(MKDEP) --dep-path . --dep-path libnxflat \
- $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+ $(CC) -- $(CFLAGS) -- $(BINFMT_SRCS) >Make.dep
@touch $@
depend: .depend
diff --git a/nuttx/binfmt/elf.c b/nuttx/binfmt/elf.c
new file mode 100644
index 0000000000..74a35174f3
--- /dev/null
+++ b/nuttx/binfmt/elf.c
@@ -0,0 +1,259 @@
+/****************************************************************************
+ * binfmt/elf.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#ifdef CONFIG_ELF
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
+ * defined or CONFIG_ELF_DUMPBUFFER does nothing.
+ */
+
+#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
+# undef CONFIG_ELF_DUMPBUFFER
+#endif
+
+#ifdef CONFIG_ELF_DUMPBUFFER
+# define elf_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
+#else
+# define elf_dumpbuffer(m,b,n)
+#endif
+
+#ifndef MIN
+# define MIN(a,b) (a < b ? a : b)
+#endif
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int elf_loadbinary(FAR struct binary_s *binp);
+#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT)
+static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo);
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct binfmt_s g_elfbinfmt =
+{
+ NULL, /* next */
+ elf_loadbinary, /* load */
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_dumploadinfo
+ ****************************************************************************/
+
+#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT)
+static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo)
+{
+ unsigned long dsize = loadinfo->datasize + loadinfo->bsssize;
+
+ bdbg("LOAD_INFO:\n");
+ bdbg(" ISPACE:\n");
+ bdbg(" ispace: %08lx\n", loadinfo->ispace);
+ bdbg(" entryoffs: %08lx\n", loadinfo->entryoffs);
+ bdbg(" isize: %08lx\n", loadinfo->isize);
+
+ bdbg(" DSPACE:\n");
+ bdbg(" dspace: %08lx\n", loadinfo->dspace);
+ if (loadinfo->dspace != NULL)
+ {
+ bdbg(" crefs: %d\n", loadinfo->dspace->crefs);
+ bdbg(" region: %08lx\n", loadinfo->dspace->region);
+ }
+ bdbg(" datasize: %08lx\n", loadinfo->datasize);
+ bdbg(" bsssize: %08lx\n", loadinfo->bsssize);
+ bdbg(" (pad): %08lx\n", loadinfo->dsize - dsize);
+ bdbg(" stacksize: %08lx\n", loadinfo->stacksize);
+ bdbg(" dsize: %08lx\n", loadinfo->dsize);
+
+ bdbg(" RELOCS:\n");
+ bdbg(" relocstart: %08lx\n", loadinfo->relocstart);
+ bdbg(" reloccount: %d\n", loadinfo->reloccount);
+
+ bdbg(" HANDLES:\n");
+ bdbg(" filfd: %d\n", loadinfo->filfd);
+}
+#else
+# define elf_dumploadinfo(i)
+#endif
+
+/****************************************************************************
+ * Name: elf_loadbinary
+ *
+ * Description:
+ * Verify that the file is an ELF binary and, if so, load the ELF
+ * binary into memory
+ *
+ ****************************************************************************/
+
+static int elf_loadbinary(struct binary_s *binp)
+{
+ struct elf_loadinfo_s loadinfo; /* Contains globals for libelf */
+ int ret;
+
+ bvdbg("Loading file: %s\n", binp->filename);
+
+ /* Initialize the xflat library to load the program binary. */
+
+ ret = elf_init(binp->filename, &loadinfo);
+ elf_dumploadinfo(&loadinfo);
+ if (ret != 0)
+ {
+ bdbg("Failed to initialize for load of NXFLT program: %d\n", ret);
+ goto errout;
+ }
+
+ /* Load the program binary */
+
+ ret = elf_load(&loadinfo);
+ elf_dumploadinfo(&loadinfo);
+ if (ret != 0)
+ {
+ bdbg("Failed to load NXFLT program binary: %d\n", ret);
+ goto errout_with_init;
+ }
+
+ /* Bind the program to the exported symbol table */
+
+ ret = elf_bind(&loadinfo, binp->exports, binp->nexports);
+ if (ret != 0)
+ {
+ bdbg("Failed to bind symbols program binary: %d\n", ret);
+ goto errout_with_load;
+ }
+
+ /* Return the load information */
+
+ binp->entrypt = (main_t)(loadinfo.ispace + loadinfo.entryoffs);
+ binp->ispace = (void*)loadinfo.ispace;
+ binp->dspace = (void*)loadinfo.dspace;
+ binp->isize = loadinfo.isize;
+ binp->stacksize = loadinfo.stacksize;
+
+ elf_dumpbuffer("Entry code", (FAR const uint8_t*)binp->entrypt,
+ MIN(binp->isize - loadinfo.entryoffs,512));
+
+ elf_uninit(&loadinfo);
+ return OK;
+
+errout_with_load:
+ elf_unload(&loadinfo);
+errout_with_init:
+ elf_uninit(&loadinfo);
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_initialize
+ *
+ * Description:
+ * ELF support is built unconditionally. However, it order to
+ * use this binary format, this function must be called during system
+ * format in order to register the ELF binary format.
+ *
+ * Returned Value:
+ * This is a NuttX internal function so it follows the convention that
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_initialize(void)
+{
+ int ret;
+
+ /* Register ourselves as a binfmt loader */
+
+ bvdbg("Registering ELF\n");
+
+ ret = register_binfmt(&g_elfbinfmt);
+ if (ret != 0)
+ {
+ bdbg("Failed to register binfmt: %d\n", ret);
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+ * Name: elf_uninitialize
+ *
+ * Description:
+ * Unregister the ELF binary loader
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void elf_uninitialize(void)
+{
+ unregister_binfmt(&g_elfbinfmt);
+}
+
+#endif /* CONFIG_ELF */
+
diff --git a/nuttx/binfmt/libelf/Kconfig b/nuttx/binfmt/libelf/Kconfig
new file mode 100644
index 0000000000..c47bc9f9eb
--- /dev/null
+++ b/nuttx/binfmt/libelf/Kconfig
@@ -0,0 +1,9 @@
+#
+# For a description of the syntax of this configuration file,
+# see misc/tools/kconfig-language.txt.
+#
+
+config ELF_DUMPBUFFER
+ bool "Dump ELF buffers"
+ default n
+ depends on DEBUG && DEBUG_VERBOSE
diff --git a/nuttx/binfmt/libelf/Make.defs b/nuttx/binfmt/libelf/Make.defs
new file mode 100644
index 0000000000..6299618637
--- /dev/null
+++ b/nuttx/binfmt/libelf/Make.defs
@@ -0,0 +1,53 @@
+############################################################################
+# binfmt/libelf/Make.defs
+#
+# Copyright (C) 2012 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+ifeq ($(CONFIG_ELF),y)
+
+# ELF application interfaces
+
+BINFMT_CSRCS += elf.c
+
+# ELF library
+
+BINFMT_CSRCS = libelf_init.c libelf_uninit.c libelf_load.c \
+ libelf_unload.c libelf_verify.c libelf_read.c \
+ libelf_bind.c
+
+# Hook the libelf subdirectory into the build
+
+VPATH += libelf
+SUBDIRS += libelf
+
+endif
diff --git a/nuttx/binfmt/libelf/gnu-elf.ld b/nuttx/binfmt/libelf/gnu-elf.ld
new file mode 100644
index 0000000000..703f369812
--- /dev/null
+++ b/nuttx/binfmt/libelf/gnu-elf.ld
@@ -0,0 +1,187 @@
+/****************************************************************************
+ * examples/elf/gnu-elf-gotoff.ld
+ *
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+MEMORY
+{
+ ISPACE : ORIGIN = 0x0, LENGTH = 2097152
+ DSPACE : ORIGIN = 0x0, LENGTH = 2097152
+}
+
+/****************************************************************************
+ * The XFLAT program image is divided into two segments:
+ *
+ * (1) ISpace (Instruction Space). This is the segment that contains
+ * code (.text). Everything in the segment should be fetch-able
+ * machine PC instructions (jump, branch, call, etc.).
+ * (2) DSpace (Data Space). This is the segment that contains both
+ * read-write data (.data, .bss) as well as read-only data (.rodata).
+ * Everything in this segment should be access-able with machine
+ * PIC load and store instructions.
+ *
+ * Older versions of GCC (at least up to GCC 4.3.3), use GOT-relative
+ * addressing to access RO data. In that case, read-only data (.rodata) must
+ * reside in D-Space and this linker script should be used.
+ *
+ * Newer versions of GCC (at least as of GCC 4.6.3), use PC-relative
+ * addressing to access RO data. In that case, read-only data (.rodata) must
+ * reside in I-Space and this linker script should NOT be used with those
+ * newer tools.
+ *
+ ****************************************************************************/
+
+SECTIONS
+{
+ .text 0x00000000 :
+ {
+ /* ISpace is located at address 0. Every (unrelocated) ISpace
+ * address is an offset from the begining of this segment.
+ */
+
+ text_start = . ;
+
+ *(.text)
+ *(.text.*)
+ *(.gnu.warning)
+ *(.stub)
+ *(.glue_7)
+ *(.glue_7t)
+ *(.jcr)
+
+ /* C++ support: The .init and .fini sections contain XFLAT-
+ * specific logic to manage static constructors and destructors.
+ */
+
+ *(.gnu.linkonce.t.*)
+ *(.init)
+ *(.fini)
+
+ /* This is special code area at the end of the normal
+ text section. It contains a small lookup table at
+ the start followed by the code pointed to by entries
+ in the lookup table. */
+
+ . = ALIGN (4) ;
+ PROVIDE(__ctbp = .);
+ *(.call_table_data)
+ *(.call_table_text)
+
+ _etext = . ;
+
+ } > ISPACE
+
+ /* DSpace is also located at address 0. Every (unrelocated) DSpace
+ * address is an offset from the begining of this segment.
+ */
+
+ .data 0x00000000 :
+ {
+ /* In this model, .rodata is access using PC-relative addressing
+ * and, hence, must also reside in the .text section.
+ */
+
+ __data_start = . ;
+ *(.rodata)
+ *(.rodata1)
+ *(.rodata.*)
+ *(.gnu.linkonce.r*)
+
+ *(.data)
+ *(.data1)
+ *(.data.*)
+ *(.gnu.linkonce.d*)
+ *(.data1)
+ *(.eh_frame)
+ *(.gcc_except_table)
+
+ *(.gnu.linkonce.s.*)
+ *(__libc_atexit)
+ *(__libc_subinit)
+ *(__libc_subfreeres)
+ *(.note.ABI-tag)
+
+ /* C++ support. For each global and static local C++ object,
+ * GCC creates a small subroutine to construct the object. Pointers
+ * to these routines (not the routines themselves) are stored as
+ * simple, linear arrays in the .ctors section of the object file.
+ * Similarly, pointers to global/static destructor routines are
+ * stored in .dtors.
+ */
+
+ *(.gnu.linkonce.d.*)
+
+ _ctors_start = . ;
+ *(.ctors)
+ _ctors_end = . ;
+ _dtors_start = . ;
+ *(.dtors)
+ _dtors_end = . ;
+
+ _edata = . ;
+ edata = ALIGN( 0x10 ) ;
+ } > DSPACE
+
+ .bss :
+ {
+ __bss_start = _edata ;
+ *(.dynsbss)
+ *(.sbss)
+ *(.sbss.*)
+ *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(.bss.*)
+ *(.bss*)
+ *(.gnu.linkonce.b*)
+ *(COMMON)
+ end = ALIGN( 0x10 ) ;
+ _end = ALIGN( 0x10 ) ;
+ } > DSPACE
+
+ .got 0 : { *(.got.plt) *(.got) }
+ .junk 0 : { *(.rel*) *(.rela*) }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/nuttx/binfmt/libelf/libelf_bind.c b/nuttx/binfmt/libelf/libelf_bind.c
new file mode 100644
index 0000000000..44532ab88d
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_bind.c
@@ -0,0 +1,106 @@
+/****************************************************************************
+ * binfmt/libelf/libelf_bind.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
+ * defined or CONFIG_ELF_DUMPBUFFER does nothing.
+ */
+
+#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
+# undef CONFIG_ELF_DUMPBUFFER
+#endif
+
+#ifdef CONFIG_ELF_DUMPBUFFER
+# define elf_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
+#else
+# define elf_dumpbuffer(m,b,n)
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_bind
+ *
+ * Description:
+ * Bind the imported symbol names in the loaded module described by
+ * 'loadinfo' using the exported symbol values provided by 'symtab'.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_bind(FAR struct elf_loadinfo_s *loadinfo,
+ FAR const struct symtab_s *exports, int nexports)
+{
+#warning "Missing logic"
+ return -ENOSYS;
+}
+
diff --git a/nuttx/binfmt/libelf/libelf_init.c b/nuttx/binfmt/libelf/libelf_init.c
new file mode 100644
index 0000000000..d72e96b622
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_init.c
@@ -0,0 +1,189 @@
+/****************************************************************************
+ * binfmt/libelf/libelf_init.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
+ * defined or CONFIG_ELF_DUMPBUFFER does nothing.
+ */
+
+#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
+# undef CONFIG_ELF_DUMPBUFFER
+#endif
+
+#ifdef CONFIG_ELF_DUMPBUFFER
+# define elf_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
+#else
+# define elf_dumpbuffer(m,b,n)
+#endif
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_init
+ *
+ * Description:
+ * This function is called to configure the library to process an ELF
+ * program binary.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
+{
+ uint32_t datastart;
+ uint32_t dataend;
+ uint32_t bssstart;
+ uint32_t bssend;
+ int ret;
+
+ bvdbg("filename: %s loadinfo: %p\n", filename, loadinfo);
+
+ /* Clear the load info structure */
+
+ memset(loadinfo, 0, sizeof(struct elf_loadinfo_s));
+
+ /* Open the binary file */
+
+ loadinfo->filfd = open(filename, O_RDONLY);
+ if (loadinfo->filfd < 0)
+ {
+ bdbg("Failed to open ELF binary %s: %d\n", filename, ret);
+ return -errno;
+ }
+
+ /* Read the ELF header from offset 0 */
+
+ ret = elf_read(loadinfo, (char*)&loadinfo->header,
+ sizeof(struct elf_hdr_s), 0);
+ if (ret < 0)
+ {
+ bdbg("Failed to read ELF header: %d\n", ret);
+ return ret;
+ }
+
+ elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header,
+ sizeof(struct elf_hdr_s));
+
+ /* Verify the ELF header */
+
+ if (elf_verifyheader(&loadinfo->header) != 0)
+ {
+ /* This is not an error because we will be called to attempt loading
+ * EVERY binary. Returning -ENOEXEC simply informs the system that
+ * the file is not an ELF file. Besides, if there is something worth
+ * complaining about, nelf_verifyheader() has already
+ * done so.
+ */
+
+ bdbg("Bad ELF header\n");
+ return -ENOEXEC;
+ }
+
+ /* Save all of the input values in the loadinfo structure
+ * and extract some additional information from the xflat
+ * header. Note that the information in the xflat header is in
+ * network order.
+ */
+
+ datastart = ntohl(loadinfo->header.h_datastart);
+ dataend = ntohl(loadinfo->header.h_dataend);
+ bssstart = dataend;
+ bssend = ntohl(loadinfo->header.h_bssend);
+
+ /* And put this information into the loadinfo structure as well.
+ *
+ * Note that:
+ *
+ * isize = the address range from 0 up to datastart.
+ * datasize = the address range from datastart up to dataend
+ * bsssize = the address range from dataend up to bssend.
+ */
+
+ loadinfo->entryoffs = ntohl(loadinfo->header.h_entry);
+ loadinfo->isize = datastart;
+
+ loadinfo->datasize = dataend - datastart;
+ loadinfo->bsssize = bssend - dataend;
+ loadinfo->stacksize = ntohl(loadinfo->header.h_stacksize);
+
+ /* This is the initial dspace size. We'll re-calculate this later
+ * after the memory has been allocated.
+ */
+
+ loadinfo->dsize = bssend - datastart;
+
+ /* Get the offset to the start of the relocations (we'll relocate
+ * this later).
+ */
+
+ loadinfo->relocstart = ntohl(loadinfo->header.h_relocstart);
+ loadinfo->reloccount = ntohs(loadinfo->header.h_reloccount);
+
+ return 0;
+}
+
diff --git a/nuttx/binfmt/libelf/libelf_load.c b/nuttx/binfmt/libelf/libelf_load.c
new file mode 100644
index 0000000000..94d200b568
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_load.c
@@ -0,0 +1,91 @@
+/****************************************************************************
+ * binfmt/libelf/libelf_load.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+#ifndef MAX
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+#endif
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_load
+ *
+ * Description:
+ * Loads the binary into memory, allocating memory, performing relocations
+ * and inializing the data and bss segments.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_load(FAR struct elf_loadinfo_s *loadinfo)
+{
+# warning "Missing logic"
+ return -ENOSYS;
+}
+
diff --git a/nuttx/binfmt/libelf/libelf_read.c b/nuttx/binfmt/libelf/libelf_read.c
new file mode 100644
index 0000000000..5f00a531e4
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_read.c
@@ -0,0 +1,165 @@
+/****************************************************************************
+ * binfmt/libelf/libelf_read.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+#undef ELF_DUMP_READDATA /* Define to dump all file data read */
+#define DUMPER lib_rawprintf /* If ELF_DUMP_READDATA is defined, this
+ * is the API used to dump data */
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_dumpreaddata
+ ****************************************************************************/
+
+#if defined(ELF_DUMP_READDATA)
+static inline void elf_dumpreaddata(char *buffer, int buflen)
+{
+ uint32_t *buf32 = (uint32_t*)buffer;
+ int i;
+ int j;
+
+ for (i = 0; i < buflen; i += 32)
+ {
+ DUMPER("%04x:", i);
+ for (j = 0; j < 32; j += sizeof(uint32_t))
+ {
+ DUMPER(" %08x", *buf32++);
+ }
+ DUMPER("\n");
+ }
+}
+#else
+# define elf_dumpreaddata(b,n)
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_read
+ *
+ * Description:
+ * Read 'readsize' bytes from the object file at 'offset'
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_read(struct elf_loadinfo_s *loadinfo, char *buffer, int readsize, int offset)
+{
+ ssize_t nbytes; /* Number of bytes read */
+ off_t rpos; /* Position returned by lseek */
+ char *bufptr; /* Next buffer location to read into */
+ int bytesleft; /* Number of bytes of .data left to read */
+ int bytesread; /* Total number of bytes read */
+
+ bvdbg("Read %d bytes from offset %d\n", readsize, offset);
+
+ /* Seek to the position in the object file where the initialized
+ * data is saved.
+ */
+
+ bytesread = 0;
+ bufptr = buffer;
+ bytesleft = readsize;
+ do
+ {
+ rpos = lseek(loadinfo->filfd, offset, SEEK_SET);
+ if (rpos != offset)
+ {
+ bdbg("Failed to seek to position %d: %d\n", offset, errno);
+ return -errno;
+ }
+
+ /* Read the file data at offset into the user buffer */
+
+ nbytes = read(loadinfo->filfd, bufptr, bytesleft);
+ if (nbytes < 0)
+ {
+ if (errno != EINTR)
+ {
+ bdbg("Read of .data failed: %d\n", errno);
+ return -errno;
+ }
+ }
+ else if (nbytes == 0)
+ {
+ bdbg("Unexpected end of file\n");
+ return -ENODATA;
+ }
+ else
+ {
+ bytesread += nbytes;
+ bytesleft -= nbytes;
+ bufptr += nbytes;
+ offset += nbytes;
+ }
+ }
+ while (bytesread < readsize);
+
+ elf_dumpreaddata(buffer, readsize);
+ return OK;
+}
+
diff --git a/nuttx/binfmt/libelf/libelf_uninit.c b/nuttx/binfmt/libelf/libelf_uninit.c
new file mode 100644
index 0000000000..cd7ae72827
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_uninit.c
@@ -0,0 +1,85 @@
+/****************************************************************************
+ * binfmt/libelf/libelf_uninit.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_uninit
+ *
+ * Description:
+ * Releases any resources committed by elf_init(). This essentially
+ * undoes the actions of elf_init.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_uninit(struct elf_loadinfo_s *loadinfo)
+{
+ if (loadinfo->filfd >= 0)
+ {
+ close(loadinfo->filfd);
+ }
+
+ return OK;
+}
+
diff --git a/nuttx/binfmt/libelf/libelf_unload.c b/nuttx/binfmt/libelf/libelf_unload.c
new file mode 100644
index 0000000000..9e930e295f
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_unload.c
@@ -0,0 +1,97 @@
+/****************************************************************************
+ * binfmt/libelf/libelf_unload.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_unload
+ *
+ * Description:
+ * This function unloads the object from memory. This essentially
+ * undoes the actions of elf_load.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_unload(struct elf_loadinfo_s *loadinfo)
+{
+ /* Reset the contents of the info structure. */
+
+ /* Release the memory segments */
+
+ if (loadinfo->ispace)
+ {
+ kfree((void*)loadinfo->ispace, loadinfo->isize);
+ loadinfo->ispace = 0;
+ }
+
+ if (loadinfo->dspace)
+ {
+ kfree((void*)loadinfo->dspace);
+ loadinfo->dspace = 0;
+ }
+
+ return OK;
+}
+
diff --git a/nuttx/binfmt/libelf/libelf_verify.c b/nuttx/binfmt/libelf/libelf_verify.c
new file mode 100644
index 0000000000..9e265573a5
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf_verify.c
@@ -0,0 +1,88 @@
+/****************************************************************************
+ * binfmt/libelf/elf_verify.c
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_verifyheader
+ *
+ * Description:
+ * Given the header from a possible ELF executable, verify that it
+ * is an ELF executable.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+int elf_verifyheader(const struct elf_hdr_s *header)
+{
+ if (!header)
+ {
+ bdbg("NULL ELF header!");
+ return -ENOEXEC;
+ }
+
+#warning "Missing Logic"
+ return -ENOSYS;
+}
+
diff --git a/nuttx/binfmt/libnxflat/Kconfig b/nuttx/binfmt/libnxflat/Kconfig
index ae2bf31307..fdb270cfb2 100644
--- a/nuttx/binfmt/libnxflat/Kconfig
+++ b/nuttx/binfmt/libnxflat/Kconfig
@@ -2,3 +2,8 @@
# For a description of the syntax of this configuration file,
# see misc/tools/kconfig-language.txt.
#
+
+config NXFLAT_DUMPBUFFER
+ bool "Dump NXFLAT buffers"
+ default n
+ depends on DEBUG && DEBUG_VERBOSE
diff --git a/nuttx/binfmt/libnxflat/Make.defs b/nuttx/binfmt/libnxflat/Make.defs
index f979741e51..59c3ce3344 100644
--- a/nuttx/binfmt/libnxflat/Make.defs
+++ b/nuttx/binfmt/libnxflat/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# nxflat/lib/Make.defs
+# binfmt/libnxflat/Make.defs
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
@@ -33,7 +33,21 @@
#
############################################################################
-LIBNXFLAT_ASRCS =
-LIBNXFLAT_CSRCS = libnxflat_init.c libnxflat_uninit.c libnxflat_load.c \
- libnxflat_unload.c libnxflat_verify.c libnxflat_read.c \
- libnxflat_bind.c
+ifeq ($(CONFIG_NXFLAT),y)
+
+# NXFLAT application interfaces
+
+BINFMT_CSRCS += nxflat.c
+
+# NXFLAT library
+
+BINFMT_CSRCS = libnxflat_init.c libnxflat_uninit.c libnxflat_load.c \
+ libnxflat_unload.c libnxflat_verify.c libnxflat_read.c \
+ libnxflat_bind.c
+
+# Hook the libnxflat subdirectory into the build
+
+VPATH += libnxflat
+SUBDIRS += libnxflat
+
+endif
diff --git a/nuttx/binfmt/libnxflat/libnxflat_bind.c b/nuttx/binfmt/libnxflat/libnxflat_bind.c
index ca348178dd..c18a16cd8f 100644
--- a/nuttx/binfmt/libnxflat/libnxflat_bind.c
+++ b/nuttx/binfmt/libnxflat/libnxflat_bind.c
@@ -263,7 +263,6 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
result = OK;
switch (NXFLAT_RELOC_TYPE(reloc.r_info))
{
-
/* NXFLAT_RELOC_TYPE_REL32I Meaning: Object file contains a 32-bit offset
* into I-Space at the offset.
* Fixup: Add mapped I-Space address to the offset.
@@ -329,6 +328,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
nxflat_dumpbuffer("GOT", (FAR const uint8_t*)relocs, nrelocs * sizeof(struct nxflat_reloc_s));
}
#endif
+
return ret;
}
@@ -388,7 +388,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
offset < loadinfo->isize + loadinfo->dsize);
imports = (struct nxflat_import_s*)
- (offset - loadinfo->isize + loadinfo->dspace->region);
+ (offset - loadinfo->isize + loadinfo->dspace->region);
/* Now, traverse the list of imported symbols and attempt to bind
* each symbol to the value exported by from the exported symbol
@@ -396,41 +396,41 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
*/
for (i = 0; i < nimports; i++)
- {
- bvdbg("Import[%d] (%08p) offset: %08x func: %08x\n",
- i, &imports[i], imports[i].i_funcname, imports[i].i_funcaddress);
+ {
+ bvdbg("Import[%d] (%08p) offset: %08x func: %08x\n",
+ i, &imports[i], imports[i].i_funcname, imports[i].i_funcaddress);
- /* Get a pointer to the imported symbol name. The name itself
- * lies in the TEXT segment. But the reference to the name
- * lies in DATA segment. Therefore, the name reference should
- * have been relocated when the module was loaded.
- */
+ /* Get a pointer to the imported symbol name. The name itself
+ * lies in the TEXT segment. But the reference to the name
+ * lies in DATA segment. Therefore, the name reference should
+ * have been relocated when the module was loaded.
+ */
offset = imports[i].i_funcname;
DEBUGASSERT(offset < loadinfo->isize);
- symname = (char*)(offset + loadinfo->ispace + sizeof(struct nxflat_hdr_s));
+ symname = (char*)(offset + loadinfo->ispace + sizeof(struct nxflat_hdr_s));
- /* Find the exported symbol value for this this symbol name. */
+ /* Find the exported symbol value for this this symbol name. */
#ifdef CONFIG_SYMTAB_ORDEREDBYNAME
symbol = symtab_findorderedbyname(exports, symname, nexports);
#else
symbol = symtab_findbyname(exports, symname, nexports);
#endif
- if (!symbol)
- {
- bdbg("Exported symbol \"%s\" not found\n", symname);
+ if (!symbol)
+ {
+ bdbg("Exported symbol \"%s\" not found\n", symname);
return -ENOENT;
- }
+ }
- /* And put this into the module's import structure. */
+ /* And put this into the module's import structure. */
- imports[i].i_funcaddress = (uint32_t)symbol->sym_value;
+ imports[i].i_funcaddress = (uint32_t)symbol->sym_value;
- bvdbg("Bound import[%d] (%08p) to export '%s' (%08x)\n",
- i, &imports[i], symname, imports[i].i_funcaddress);
- }
+ bvdbg("Bound import[%d] (%08p) to export '%s' (%08x)\n",
+ i, &imports[i], symname, imports[i].i_funcaddress);
+ }
}
/* Dump the relocation import table */
@@ -441,6 +441,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
nxflat_dumpbuffer("Imports", (FAR const uint8_t*)imports, nimports * sizeof(struct nxflat_import_s));
}
#endif
+
return OK;
}
@@ -484,9 +485,10 @@ int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo,
*/
memset((void*)(loadinfo->dspace->region + loadinfo->datasize),
- 0, loadinfo->bsssize);
+ 0, loadinfo->bsssize);
}
}
+
return ret;
}
diff --git a/nuttx/binfmt/libnxflat/libnxflat_uninit.c b/nuttx/binfmt/libnxflat/libnxflat_uninit.c
index 5d06296c79..c507fdc14c 100644
--- a/nuttx/binfmt/libnxflat/libnxflat_uninit.c
+++ b/nuttx/binfmt/libnxflat/libnxflat_uninit.c
@@ -56,10 +56,6 @@
* Private Functions
****************************************************************************/
-/****************************************************************************
- * Name: nxflat_swap32
- ****************************************************************************/
-
/****************************************************************************
* Public Functions
****************************************************************************/
diff --git a/nuttx/binfmt/libnxflat/libnxflat_verify.c b/nuttx/binfmt/libnxflat/libnxflat_verify.c
index f799aca4f6..da25d21c71 100644
--- a/nuttx/binfmt/libnxflat/libnxflat_verify.c
+++ b/nuttx/binfmt/libnxflat/libnxflat_verify.c
@@ -91,10 +91,10 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header)
if (strncmp(header->h_magic, NXFLAT_MAGIC, 4) != 0)
{
bdbg("Unrecognized magic=\"%c%c%c%c\"\n",
- header->h_magic[0], header->h_magic[1],
- header->h_magic[2], header->h_magic[3]);
+ header->h_magic[0], header->h_magic[1],
+ header->h_magic[2], header->h_magic[3]);
return -ENOEXEC;
}
+
return OK;
}
-
diff --git a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs
index 55da02a154..eebe11c22a 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/lpcxpresso-lpc1768/dhcpd/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/dhcpd/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/dhcpd/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs
index 52831a2794..c8fb0e9aec 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/lpcxpresso-lpc1768/nsh/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nsh/ld.script b/nuttx/configs/lpcxpresso-lpc1768/nsh/ld.script
deleted file mode 100755
index f37c4accb0..0000000000
--- a/nuttx/configs/lpcxpresso-lpc1768/nsh/ld.script
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
- * configs/lpcxpresso-lpc1768/nsh/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1768 has 512Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs
index 59aeb51875..b0334ba46d 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/lpcxpresso-lpc1768/nx/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nx/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nx/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nx/ld.script b/nuttx/configs/lpcxpresso-lpc1768/nx/ld.script
deleted file mode 100755
index f1a49e3aab..0000000000
--- a/nuttx/configs/lpcxpresso-lpc1768/nx/ld.script
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
- * configs/lpcxpresso-lpc1768/nx/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1768 has 512Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs
index 6d228a9363..1e1f2d9795 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/lpcxpresso-lpc1768/ostest/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/lpcxpresso-lpc1768/ostest/ld.script b/nuttx/configs/lpcxpresso-lpc1768/ostest/ld.script
deleted file mode 100755
index da29a1482e..0000000000
--- a/nuttx/configs/lpcxpresso-lpc1768/ostest/ld.script
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
- * configs/lpcxpresso-lpc1768/ostest/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1768 has 512Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/ld.script b/nuttx/configs/lpcxpresso-lpc1768/scripts/ld.script
similarity index 95%
rename from nuttx/configs/lpcxpresso-lpc1768/dhcpd/ld.script
rename to nuttx/configs/lpcxpresso-lpc1768/scripts/ld.script
index d8f4444753..bdfa155476 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/ld.script
+++ b/nuttx/configs/lpcxpresso-lpc1768/scripts/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
- * configs/lpcxpresso-lpc1768/dhcpd/ld.script
+ * configs/lpcxpresso-lpc1768/scripts/ld.script
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -94,7 +94,8 @@ SECTIONS
_ebss = ABSOLUTE(.);
} > sram
- /* Stabs debugging sections. */
+ /* Stabs debugging sections */
+
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs
index 0f3212522f..93bcfa376e 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs
@@ -86,7 +86,7 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
NXFLATLDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld}"
else
@@ -94,7 +94,7 @@ else
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
NXFLATLDSCRIPT = -T"$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld"
endif
diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/ld.script b/nuttx/configs/lpcxpresso-lpc1768/thttpd/ld.script
deleted file mode 100755
index 37ec255327..0000000000
--- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/ld.script
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
- * configs/lpcxpresso-lpc1768/thttpd/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1768 has 512Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs
index 793dfcdf19..e546666e75 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/lpcxpresso-lpc1768/usbstorage/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt
#
# Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/ld.script b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/ld.script
deleted file mode 100755
index 7cccb8421f..0000000000
--- a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/ld.script
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
- * configs/lpcxpresso-lpc1768/usbstorage/ld.script
- *
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The LPC1768 has 512Kb of FLASH beginning at address 0x0000:0000 and
- * 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
- * 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
- * 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
- * into the 32Kb CPU SRAM address range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x00000000, LENGTH = 512K
- sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- _eronly = ABSOLUTE(.);
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } >sram
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/nuttx/include/elf.h b/nuttx/include/elf.h
new file mode 100644
index 0000000000..8d6539c36c
--- /dev/null
+++ b/nuttx/include/elf.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ * include/elf.h
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_ELF_H
+#define __INCLUDE_ELF_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+#endif /* __INCLUDE_ELF_H */
diff --git a/nuttx/include/nuttx/elf.h b/nuttx/include/nuttx/elf.h
new file mode 100644
index 0000000000..4be2c23a04
--- /dev/null
+++ b/nuttx/include/nuttx/elf.h
@@ -0,0 +1,259 @@
+/****************************************************************************
+ * include/nuttx/elf.h
+ *
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_ELF_H
+#define __INCLUDE_NUTTX_ELF_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* This struct provides a desciption of the currently loaded instantiation
+ * of an ELF binary.
+ */
+
+struct elf_loadinfo_s
+{
+ /* Instruction Space (ISpace): This region contains the ELF file header
+ * plus everything from the text section. Ideally, will have only one mmap'ed
+ * text section instance in the system for each module.
+ */
+
+ uint32_t ispace; /* Address where hdr/text is loaded */
+ uint32_t entryoffs; /* Offset from ispace to entry point */
+ uint32_t isize; /* Size of ispace. */
+
+ /* Data Space (DSpace): This region contains all information that in referenced
+ * as data (other than the stack which is separately allocated). There will be
+ * a unique instance of DSpace (and stack) for each instance of a process.
+ */
+
+ FAR struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */
+ uint32_t datasize; /* Size of data segment in dspace */
+ uint32_t bsssize; /* Size of bss segment in dspace */
+ uint32_t stacksize; /* Size of stack (not allocated) */
+ uint32_t dsize; /* Size of dspace (may be large than parts) */
+
+ /* This is temporary memory where relocation records will be loaded. */
+
+ uint32_t relocstart; /* Start of array of struct flat_reloc */
+ uint16_t reloccount; /* Number of elements in reloc array */
+
+ /* File descriptors */
+
+ int filfd; /* Descriptor for the file being loaded */
+
+ /* This is a copy of the ELF header (still in network order) */
+
+ FAR struct elf_hdr_s header;
+};
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * These are APIs exported by libelf (and may be used outside of NuttX):
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: elf_verifyheader
+ *
+ * Description:
+ * Given the header from a possible ELF executable, verify that it is
+ * an ELF executable.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_verifyheader(FAR const struct elf_hdr_s *header);
+
+/****************************************************************************
+ * Name: elf_init
+ *
+ * Description:
+ * This function is called to configure the library to process an ELF
+ * program binary.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_init(FAR const char *filename,
+ FAR struct elf_loadinfo_s *loadinfo);
+
+/****************************************************************************
+ * Name: elf_uninit
+ *
+ * Description:
+ * Releases any resources committed by elf_init(). This essentially
+ * undoes the actions of elf_init.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_uninit(FAR struct elf_loadinfo_s *loadinfo);
+
+/****************************************************************************
+ * Name: elf_load
+ *
+ * Description:
+ * Loads the binary into memory, allocating memory, performing relocations
+ * and inializing the data and bss segments.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_load(FAR struct elf_loadinfo_s *loadinfo);
+
+/****************************************************************************
+ * Name: elf_read
+ *
+ * Description:
+ * Read 'readsize' bytes from the object file at 'offset'
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_read(FAR struct elf_loadinfo_s *loadinfo, FAR char *buffer,
+ FAR int readsize, int offset);
+
+/****************************************************************************
+ * Name: elf_bind
+ *
+ * Description:
+ * Bind the imported symbol names in the loaded module described by
+ * 'loadinfo' using the exported symbol values provided by 'symtab'.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+struct symtab_s;
+EXTERN int elf_bind(FAR struct elf_loadinfo_s *loadinfo,
+ FAR const struct symtab_s *exports, int nexports);
+
+/****************************************************************************
+ * Name: elf_unload
+ *
+ * Description:
+ * This function unloads the object from memory. This essentially
+ * undoes the actions of elf_load.
+ *
+ * Returned Value:
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_unload(struct elf_loadinfo_s *loadinfo);
+
+/****************************************************************************
+ * These are APIs used internally only by NuttX:
+ ****************************************************************************/
+/****************************************************************************
+ * Name: elf_initialize
+ *
+ * Description:
+ * ELF support is built unconditionally. However, it order to
+ * use this binary format, this function must be called during system
+ * format in order to register the ELF binary format.
+ *
+ * Returned Value:
+ * This is a NuttX internal function so it follows the convention that
+ * 0 (OK) is returned on success and a negated errno is returned on
+ * failure.
+ *
+ ****************************************************************************/
+
+EXTERN int elf_initialize(void);
+
+/****************************************************************************
+ * Name: elf_uninitialize
+ *
+ * Description:
+ * Unregister the ELF binary loader
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+EXTERN void elf_uninitialize(void);
+
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __INCLUDE_NUTTX_ELF_H */
diff --git a/nuttx/include/nuttx/nxflat.h b/nuttx/include/nuttx/nxflat.h
index b6501522ef..59dcea854a 100644
--- a/nuttx/include/nuttx/nxflat.h
+++ b/nuttx/include/nuttx/nxflat.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/nxflat.h
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -110,22 +110,22 @@ extern "C" {
* These are APIs exported by libnxflat (and may be used outside of NuttX):
****************************************************************************/
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_verifyheader
*
* Description:
- * Given the header from a possible NXFLAT executable, verify that it
- * is an NXFLAT executable.
+ * Given the header from a possible NXFLAT executable, verify that it is
+ * an NXFLAT executable.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_verifyheader(const struct nxflat_hdr_s *header);
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_init
*
* Description:
@@ -136,12 +136,12 @@ EXTERN int nxflat_verifyheader(const struct nxflat_hdr_s *header);
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_init(const char *filename,
struct nxflat_loadinfo_s *loadinfo);
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_uninit
*
* Description:
@@ -152,11 +152,11 @@ EXTERN int nxflat_init(const char *filename,
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_uninit(struct nxflat_loadinfo_s *loadinfo);
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_load
*
* Description:
@@ -170,11 +170,11 @@ EXTERN int nxflat_uninit(struct nxflat_loadinfo_s *loadinfo);
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_load(struct nxflat_loadinfo_s *loadinfo);
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_read
*
* Description:
@@ -184,12 +184,12 @@ EXTERN int nxflat_load(struct nxflat_loadinfo_s *loadinfo);
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer,
int readsize, int offset);
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_bind
*
* Description:
@@ -202,13 +202,13 @@ EXTERN int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer,
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
struct symtab_s;
EXTERN int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo,
FAR const struct symtab_s *exports, int nexports);
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_unload
*
* Description:
@@ -219,14 +219,14 @@ EXTERN int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo,
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_unload(struct nxflat_loadinfo_s *loadinfo);
/****************************************************************************
* These are APIs used internally only by NuttX:
****************************************************************************/
-/***********************************************************************
+/****************************************************************************
* Name: nxflat_initialize
*
* Description:
@@ -239,7 +239,7 @@ EXTERN int nxflat_unload(struct nxflat_loadinfo_s *loadinfo);
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
- ***********************************************************************/
+ ****************************************************************************/
EXTERN int nxflat_initialize(void);
From bd76ec3dc037b6bd3aba883118cbac51510b80fa Mon Sep 17 00:00:00 2001
From: patacongo
Date: Wed, 24 Oct 2012 18:22:15 +0000
Subject: [PATCH 020/206] Flesh out include/elf.h
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5251 42af7a65-404d-4744-a932-0658087f49c3
---
nuttx/binfmt/libelf/arm.h | 53 +++++++
nuttx/binfmt/libelf/libelf.h | 53 +++++++
nuttx/include/elf.h | 279 ++++++++++++++++++++++++++++++++++-
3 files changed, 384 insertions(+), 1 deletion(-)
create mode 100644 nuttx/binfmt/libelf/arm.h
create mode 100644 nuttx/binfmt/libelf/libelf.h
diff --git a/nuttx/binfmt/libelf/arm.h b/nuttx/binfmt/libelf/arm.h
new file mode 100644
index 0000000000..e80457b6e4
--- /dev/null
+++ b/nuttx/binfmt/libelf/arm.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ * binfmt/libelf/arm.h
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __BINFMT_LIBELF_ARM_H
+#define __BINFMT_LIBELF_ARM_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+#endif /* __BINFMT_LIBELF_ARM_H */
diff --git a/nuttx/binfmt/libelf/libelf.h b/nuttx/binfmt/libelf/libelf.h
new file mode 100644
index 0000000000..80d971bca2
--- /dev/null
+++ b/nuttx/binfmt/libelf/libelf.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ * binfmt/libelf/libelf.h
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __BINFMT_LIBELF_LIBELF_H
+#define __BINFMT_LIBELF_LIBELF_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+#endif /* __BINFMT_LIBELF_LIBELF_H */
diff --git a/nuttx/include/elf.h b/nuttx/include/elf.h
index 8d6539c36c..31818249fa 100644
--- a/nuttx/include/elf.h
+++ b/nuttx/include/elf.h
@@ -4,6 +4,9 @@
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
+ * Reference: System V Application Binary Interface, Edition 4.1, March 18,
+ * 1997, The Santa Cruz Operation, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -42,12 +45,286 @@
#include
+#include
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
- * Public Types
+ * Pre-processor Definitions
****************************************************************************/
+/* Values for Elf32_Ehdr::e_type */
+
+#define ET_NONE 0 /* No file type */
+#define ET_REL 1 /* Relocatable file */
+#define ET_EXEC 2 /* Executable file */
+#define ET_DYN 3 /* Shared object file */
+#define ET_CORE 4 /* Core file */
+#define ET_LOPROC 0xff00 /* Processor-specific */
+#define ET_HIPROC 0xffff /* Processor-specific */
+
+/* Values for Elf32_Ehdr::e_machine */
+
+#define EM_NONE 0 /* No machine */
+#define EM_M32 1 /* AT&T WE 32100 */
+#define EM_SPARC 2 /* SPARC */
+#define EM_386 3 /* Intel 80386 */
+#define EM_68K 4 /* Motorola 68000 */
+#define EM_88K 5 /* Motorola 88000 */
+#define EM_860 7 /* Intel 80860 */
+#define EM_MIPS 8 /* MIPS RS3000 Big-Endian */
+#define EM_MIPS_RS4_BE 10 /* MIPS RS4000 Big-Endian */
+ /* 11-16 Reserved for future use */
+
+/* Values for Elf32_Ehdr::e_version */
+
+#define EV_NONE 0 /* Invalid version */
+#define EV_CURRENT 1 /* The current version */
+
+/* Ehe ELF identifier */
+
+#define EI_MAG0 0 /* File identification */
+#define EI_MAG1 1 /* File identification */
+#define EI_MAG2 2 /* File identification */
+#define EI_MAG3 3 /* File identification */
+#define EI_CLASS 4 /* File class */
+#define EI_DATA 5 /* Data encoding */
+#define EI_VERSION 6 /* File version */
+#define EI_PAD 7 /* Start of padding bytes */
+#define EI_NIDENT 16 /* Size of eident[] */
+
+#define EI_MAGIC { 0x7f, 'E', 'L', 'F' }
+
+/* Values for EI_CLASS */
+
+#define ELFCLASSNONE 0 /* Invalid class */
+#define ELFCLASS32 1 /* 32-bit objects */
+#define ELFCLASS64 2 /* 64-bit objects */
+
+/* Values for EI_DATA */
+
+#define ELFDATANONE 0 /* Invalid data encoding */
+#define ELFDATA2LSB 1 /* Least significant byte occupying the lowest address */
+#define ELFDATA2MSB 2 /* Most significant byte occupying the lowest address */
+
+/* Figure 4-7: Special Section Indexes */
+
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_HIPROC 0xff1f
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_HIRESERVE 0xffff
+
+/* Figure 4-9: Section Types, sh_type */
+
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0xffffffff
+
+/* Figure 4-11: Section Attribute Flags, sh_flags */
+
+#define SHF_WRITE 1
+#define SHF_ALLOC 2
+#define SHF_EXECINSTR 4
+#define SHF_MASKPROC 0xf0000000
+
+/* Definitions for Elf32_Sym::st_info */
+
+#define ELF32_ST_BIND(i) ((i)>>4)
+#define ELF32_ST_TYPE(i) ((i)&0xf)
+#define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
+
+/* Figure 4-16: Symbol Binding, ELF32_ST_BIND */
+
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+#define STB_LOPROC 13
+#define STB_HIPROC 15
+
+/* Figure 4-17: Symbol Types, ELF32_ST_TYPE */
+
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_LOPROC 13
+#define STT_HIPROC 15
+
+/* Definitions for Elf32_Rel*::r_info */
+
+#define ELF32_R_SYM(i) ((i)>>8)
+#define ELF32_R_TYPE(i) ((unsigned char)(i))
+#define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
+
+/* Figure 5-2: Segment Types, p_type */
+
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+
+/* Figure 5-3: Segment Flag Bits, p_flags */
+
+#define PF_X 1 /* Execute */
+#define PF_W 2 /* Write */
+#define PF_R 4 /* Read */
+#define PF_MASKPROC 0xf0000000 /* Unspecified */
+
+/* Figure 5-10: Dynamic Array Tags, d_tag */
+
+#define DT_NULL 0 /* d_un=ignored */
+#define DT_NEEDED 1 /* d_un=d_val */
+#define DT_PLTRELSZ 2 /* d_un=d_val */
+#define DT_PLTGOT 3 /* d_un=d_ptr */
+#define DT_HASH 4 /* d_un=d_ptr */
+#define DT_STRTAB 5 /* d_un=d_ptr */
+#define DT_SYMTAB 6 /* d_un=d_ptr */
+#define DT_RELA 7 /* d_un=d_ptr */
+#define DT_RELASZ 8 /* d_un=d_val */
+#define DT_RELAENT 9 /* d_un=d_val */
+#define DT_STRSZ 10 /* d_un=d_val */
+#define DT_SYMENT 11 /* d_un=d_val */
+#define DT_INIT 12 /* d_un=d_ptr */
+#define DT_FINI 13 /* d_un=d_ptr */
+#define DT_SONAME 14 /* d_un=d_val */
+#define DT_RPATH 15 /* d_un=d_val */
+#define DT_SYMBOLIC 16 /* d_un=ignored */
+#define DT_REL 17 /* d_un=d_ptr */
+#define DT_RELSZ 18 /* d_un=d_val */
+#define DT_RELENT 19 /* d_un=d_val */
+#define DT_PLTREL 20 /* d_un=d_val */
+#define DT_DEBUG 21 /* d_un=d_ptr */
+#define DT_TEXTREL 22 /* d_un=ignored */
+#define DT_JMPREL 23 /* d_un=d_ptr */
+#define DT_BINDNOW 24 /* d_un=ignored */
+#define DT_LOPROC 0x70000000 /* d_un=unspecified */
+#define DT_HIPROC 0x7fffffff /* d_un= unspecified */
+
+/****************************************************************************
+ * Public Type Definitions
+ ****************************************************************************/
+
+/* Figure 4.2: 32-Bit Data Types */
+
+typedef uint32_t ELF32_Addr /* Unsigned program address */
+typedef uint16_t ELF32_Half /* Unsigned medium integer */
+typedef uint32_t ELF32_Off /* Unsigned file offset */
+typedef int32_t ELF32_Sword /* Signed large integer */
+typedef uint32_t ELF32_Word /* Unsigned large integer */
+
+/* Figure 4-3: ELF Header */
+
+typedef struct
+{
+ unsigned char e_ident[EI_NIDENT];
+ ELF32_Half e_type;
+ ELF32_Half e_machine;
+ ELF32_Word e_version;
+ ELF32_Addr e_entry;
+ ELF32_Off e_phoff;
+ ELF32_Off e_shoff;
+ ELF32_Word e_flags;
+ ELF32_Half e_ehsize;
+ ELF32_Half e_phentsize;
+ ELF32_Half e_phnum;
+ ELF32_Half e_shentsize;
+ ELF32_Half e_shnum;
+ ELF32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+/* Figure 4-8: Section Header */
+
+typedef struct
+{
+ ELF32_Word sh_name;
+ ELF32_Word sh_type;
+ ELF32_Word sh_flags;
+ ELF32_Addr sh_addr;
+ ELF32_Off sh_offset;
+ ELF32_Word sh_size;
+ ELF32_Word sh_link;
+ ELF32_Word sh_info;
+ ELF32_Word sh_addralign;
+ ELF32_Word sh_entsize;
+} Elf32_Shdr;
+
+/* Figure 4-15: Symbol Table Entry */
+
+typedef struct
+{
+ ELF32_Word st_name;
+ ELF32_Addr st_value;
+ ELF32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ ELF32_Half st_shndx;
+} Elf32_Sym;
+
+/* Figure 4-19: Relocation Entries */
+
+typedef struct
+{
+ ELF32_Addr r_offset;
+ ELF32_Word r_info;
+} Elf32_Rel;
+
+typedef struct
+{
+ ELF32_Addr r_offset;
+ ELF32_Word r_info;
+ ELF32_Sword r_addend;
+} Elf32_Rela;
+
+/* Figure 5-1: Program Header */
+
+typedef struct
+{
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+
+/* Figure 5-9: Dynamic Structure */
+
+typedef struct
+{
+ Elf32_Sword d_tag;
+ union
+ {
+ Elf32_Word d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+//extern Elf32_Dyn _DYNAMIC[] ;
+
#endif /* __INCLUDE_ELF_H */
From 8a2348d18d16427d0787d3614aa90ab20e4b4eda Mon Sep 17 00:00:00 2001
From: patacongo
Date: Wed, 24 Oct 2012 20:19:44 +0000
Subject: [PATCH 021/206] Move binfmt.h, nxflat.h, elf.h, and symtab.h to
include/nuttx/binfmt/
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5252 42af7a65-404d-4744-a932-0658087f49c3
---
apps/examples/nxflat/nxflat_main.c | 4 ++--
apps/examples/nxflat/tests/mksymtab.sh | 2 +-
apps/examples/thttpd/content/mksymtab.sh | 2 +-
apps/examples/thttpd/thttpd_main.c | 4 ++--
apps/include/netutils/thttpd.h | 2 +-
apps/netutils/thttpd/thttpd.c | 2 +-
apps/netutils/thttpd/thttpd_cgi.c | 4 ++--
nuttx/ChangeLog | 3 +++
nuttx/Documentation/NuttXNxFlat.html | 12 ++++++------
nuttx/binfmt/binfmt_dumpmodule.c | 2 +-
nuttx/binfmt/binfmt_exec.c | 2 +-
nuttx/binfmt/binfmt_execmodule.c | 2 +-
nuttx/binfmt/binfmt_globals.c | 2 +-
nuttx/binfmt/binfmt_internal.h | 2 +-
nuttx/binfmt/binfmt_loadmodule.c | 2 +-
nuttx/binfmt/binfmt_register.c | 2 +-
nuttx/binfmt/binfmt_unloadmodule.c | 2 +-
nuttx/binfmt/binfmt_unregister.c | 2 +-
nuttx/binfmt/elf.c | 4 ++--
nuttx/binfmt/libelf/libelf_bind.c | 4 ++--
nuttx/binfmt/libelf/libelf_init.c | 8 +++-----
nuttx/binfmt/libelf/libelf_load.c | 2 +-
nuttx/binfmt/libelf/libelf_read.c | 2 +-
nuttx/binfmt/libelf/libelf_uninit.c | 2 +-
nuttx/binfmt/libelf/libelf_unload.c | 2 +-
nuttx/binfmt/libelf/libelf_verify.c | 4 ++--
nuttx/binfmt/libnxflat/libnxflat_bind.c | 4 ++--
nuttx/binfmt/libnxflat/libnxflat_init.c | 2 +-
nuttx/binfmt/libnxflat/libnxflat_load.c | 2 +-
nuttx/binfmt/libnxflat/libnxflat_read.c | 2 +-
nuttx/binfmt/libnxflat/libnxflat_uninit.c | 3 ++-
nuttx/binfmt/libnxflat/libnxflat_unload.c | 2 +-
nuttx/binfmt/libnxflat/libnxflat_verify.c | 3 ++-
nuttx/binfmt/nxflat.c | 4 ++--
nuttx/binfmt/symtab_findbyname.c | 2 +-
nuttx/binfmt/symtab_findbyvalue.c | 2 +-
nuttx/binfmt/symtab_findorderedbyname.c | 2 +-
nuttx/binfmt/symtab_findorderedbyvalue.c | 2 +-
nuttx/include/nuttx/{ => binfmt}/binfmt.h | 10 +++++-----
nuttx/include/nuttx/{ => binfmt}/elf.h | 16 ++++++++--------
nuttx/include/nuttx/{ => binfmt}/nxflat.h | 8 ++++----
nuttx/include/nuttx/{ => binfmt}/symtab.h | 8 ++++----
nuttx/tools/mksymtab.c | 2 +-
43 files changed, 79 insertions(+), 76 deletions(-)
rename nuttx/include/nuttx/{ => binfmt}/binfmt.h (97%)
rename nuttx/include/nuttx/{ => binfmt}/elf.h (96%)
rename nuttx/include/nuttx/{ => binfmt}/nxflat.h (98%)
rename nuttx/include/nuttx/{ => binfmt}/symtab.h (97%)
diff --git a/apps/examples/nxflat/nxflat_main.c b/apps/examples/nxflat/nxflat_main.c
index 4cd2cd5375..2c0030c608 100644
--- a/apps/examples/nxflat/nxflat_main.c
+++ b/apps/examples/nxflat/nxflat_main.c
@@ -50,8 +50,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "tests/romfs.h"
#include "tests/dirlist.h"
diff --git a/apps/examples/nxflat/tests/mksymtab.sh b/apps/examples/nxflat/tests/mksymtab.sh
index 611d3a87a0..4b5347f17f 100755
--- a/apps/examples/nxflat/tests/mksymtab.sh
+++ b/apps/examples/nxflat/tests/mksymtab.sh
@@ -22,7 +22,7 @@ varlist=`find $dir -name "*-thunk.S"| xargs grep -h asciz | cut -f3 | sort | uni
echo "#ifndef __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
echo ""
-echo "#include "
+echo "#include "
echo ""
echo "static const struct symtab_s exports[] = "
echo "{"
diff --git a/apps/examples/thttpd/content/mksymtab.sh b/apps/examples/thttpd/content/mksymtab.sh
index 611d3a87a0..4b5347f17f 100755
--- a/apps/examples/thttpd/content/mksymtab.sh
+++ b/apps/examples/thttpd/content/mksymtab.sh
@@ -22,7 +22,7 @@ varlist=`find $dir -name "*-thunk.S"| xargs grep -h asciz | cut -f3 | sort | uni
echo "#ifndef __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
echo ""
-echo "#include "
+echo "#include "
echo ""
echo "static const struct symtab_s exports[] = "
echo "{"
diff --git a/apps/examples/thttpd/thttpd_main.c b/apps/examples/thttpd/thttpd_main.c
index b31d0a8642..97f922a768 100644
--- a/apps/examples/thttpd/thttpd_main.c
+++ b/apps/examples/thttpd/thttpd_main.c
@@ -56,8 +56,8 @@
#include
#include
-#include
-#include
+#include
+#include
#ifdef CONFIG_NET_SLIP
# include
#endif
diff --git a/apps/include/netutils/thttpd.h b/apps/include/netutils/thttpd.h
index 92ed7ba974..217914c332 100644
--- a/apps/include/netutils/thttpd.h
+++ b/apps/include/netutils/thttpd.h
@@ -42,7 +42,7 @@
#include
-#include
+#include
/****************************************************************************
* Public Data
diff --git a/apps/netutils/thttpd/thttpd.c b/apps/netutils/thttpd/thttpd.c
index 1b074902de..a04a932bf7 100644
--- a/apps/netutils/thttpd/thttpd.c
+++ b/apps/netutils/thttpd/thttpd.c
@@ -54,7 +54,7 @@
#include
#include
-#include
+#include
#include
#include "config.h"
diff --git a/apps/netutils/thttpd/thttpd_cgi.c b/apps/netutils/thttpd/thttpd_cgi.c
index 9c0de509bd..31b1e0d8dd 100644
--- a/apps/netutils/thttpd/thttpd_cgi.c
+++ b/apps/netutils/thttpd/thttpd_cgi.c
@@ -53,8 +53,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include
#include "config.h"
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 59fa735449..c2c9a1413a 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3511,3 +3511,6 @@
* binfmt/elf.c, binfmt/libelf, include/elf.h, include/nuttx/elf.h: Add
basic framework for loadable ELF module support. The initial check-
in is non-functional and is simply the framework for ELF support.
+ * include/nuttx/binfmt.h, nxflat.h, elf.h, and symtab.h: Moved to
+ include/nuttx/binfmt/.
+
diff --git a/nuttx/Documentation/NuttXNxFlat.html b/nuttx/Documentation/NuttXNxFlat.html
index c51e3b6a1d..2e6d2f59a8 100644
--- a/nuttx/Documentation/NuttXNxFlat.html
+++ b/nuttx/Documentation/NuttXNxFlat.html
@@ -554,19 +554,19 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
diff --git a/nuttx/binfmt/binfmt_dumpmodule.c b/nuttx/binfmt/binfmt_dumpmodule.c
index 32a3fef3e3..06e97e4572 100644
--- a/nuttx/binfmt/binfmt_dumpmodule.c
+++ b/nuttx/binfmt/binfmt_dumpmodule.c
@@ -43,7 +43,7 @@
#include
#include
-#include
+#include
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/binfmt_exec.c b/nuttx/binfmt/binfmt_exec.c
index c070324c31..60e8d8efde 100644
--- a/nuttx/binfmt/binfmt_exec.c
+++ b/nuttx/binfmt/binfmt_exec.c
@@ -44,7 +44,7 @@
#include
#include
-#include
+#include
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c
index 1b511b0cb8..bc76d4acfc 100644
--- a/nuttx/binfmt/binfmt_execmodule.c
+++ b/nuttx/binfmt/binfmt_execmodule.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include "os_internal.h"
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/binfmt_globals.c b/nuttx/binfmt/binfmt_globals.c
index 069d3a2aa9..d3246bd506 100644
--- a/nuttx/binfmt/binfmt_globals.c
+++ b/nuttx/binfmt/binfmt_globals.c
@@ -39,7 +39,7 @@
#include
-#include
+#include
#ifndef CONFIG_BINFMT_DISABLE
diff --git a/nuttx/binfmt/binfmt_internal.h b/nuttx/binfmt/binfmt_internal.h
index da67f5350b..4fab9724d4 100644
--- a/nuttx/binfmt/binfmt_internal.h
+++ b/nuttx/binfmt/binfmt_internal.h
@@ -42,7 +42,7 @@
#include
-#include
+#include
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/binfmt/binfmt_loadmodule.c b/nuttx/binfmt/binfmt_loadmodule.c
index 01ab8cc883..e87075aa90 100644
--- a/nuttx/binfmt/binfmt_loadmodule.c
+++ b/nuttx/binfmt/binfmt_loadmodule.c
@@ -43,7 +43,7 @@
#include
#include
-#include
+#include
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/binfmt_register.c b/nuttx/binfmt/binfmt_register.c
index 7f6eef671a..925f29353f 100644
--- a/nuttx/binfmt/binfmt_register.c
+++ b/nuttx/binfmt/binfmt_register.c
@@ -44,7 +44,7 @@
#include
#include
-#include
+#include
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c
index 04859a2910..0de9dfccd1 100644
--- a/nuttx/binfmt/binfmt_unloadmodule.c
+++ b/nuttx/binfmt/binfmt_unloadmodule.c
@@ -45,7 +45,7 @@
#include
#include
-#include
+#include
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/binfmt_unregister.c b/nuttx/binfmt/binfmt_unregister.c
index b97b9b67dd..f895e354d0 100644
--- a/nuttx/binfmt/binfmt_unregister.c
+++ b/nuttx/binfmt/binfmt_unregister.c
@@ -44,7 +44,7 @@
#include
#include
-#include
+#include
#include "binfmt_internal.h"
diff --git a/nuttx/binfmt/elf.c b/nuttx/binfmt/elf.c
index 74a35174f3..fb3b5acd23 100644
--- a/nuttx/binfmt/elf.c
+++ b/nuttx/binfmt/elf.c
@@ -47,8 +47,8 @@
#include
#include
-#include
-#include
+#include
+#include
#ifdef CONFIG_ELF
diff --git a/nuttx/binfmt/libelf/libelf_bind.c b/nuttx/binfmt/libelf/libelf_bind.c
index 44532ab88d..87afe79c9f 100644
--- a/nuttx/binfmt/libelf/libelf_bind.c
+++ b/nuttx/binfmt/libelf/libelf_bind.c
@@ -47,8 +47,8 @@
#include
#include
-#include
-#include
+#include
+#include
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/binfmt/libelf/libelf_init.c b/nuttx/binfmt/libelf/libelf_init.c
index d72e96b622..71b6b92272 100644
--- a/nuttx/binfmt/libelf/libelf_init.c
+++ b/nuttx/binfmt/libelf/libelf_init.c
@@ -48,7 +48,7 @@
#include
#include
-#include
+#include
/****************************************************************************
* Pre-Processor Definitions
@@ -118,16 +118,14 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
/* Read the ELF header from offset 0 */
- ret = elf_read(loadinfo, (char*)&loadinfo->header,
- sizeof(struct elf_hdr_s), 0);
+ ret = elf_read(loadinfo, (char*)&loadinfo->header, sizeof(Elf32_Ehdr), 0);
if (ret < 0)
{
bdbg("Failed to read ELF header: %d\n", ret);
return ret;
}
- elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header,
- sizeof(struct elf_hdr_s));
+ elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header, sizeof(Elf32_Ehdr));
/* Verify the ELF header */
diff --git a/nuttx/binfmt/libelf/libelf_load.c b/nuttx/binfmt/libelf/libelf_load.c
index 94d200b568..26785f6b1c 100644
--- a/nuttx/binfmt/libelf/libelf_load.c
+++ b/nuttx/binfmt/libelf/libelf_load.c
@@ -48,7 +48,7 @@
#include
#include
-#include