summaryrefslogtreecommitdiff
path: root/arch/arm/lpc17xx/ldscript
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-28 03:58:51 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-28 04:02:11 +0100
commit608f796648e8de74f9aac3e60db3f7d87e69e9f4 (patch)
tree2966b76b8d12e23f99c8fbd13aeccbb4d4ef8ce8 /arch/arm/lpc17xx/ldscript
parent18d53779c4fef3efca606aead2da3af40ec76332 (diff)
Work on the MPU port. The exception VTOR redirection doesn't work as expected.
Diffstat (limited to 'arch/arm/lpc17xx/ldscript')
-rw-r--r--arch/arm/lpc17xx/ldscript37
1 files changed, 28 insertions, 9 deletions
diff --git a/arch/arm/lpc17xx/ldscript b/arch/arm/lpc17xx/ldscript
index 14fe819..4f1f3b9 100644
--- a/arch/arm/lpc17xx/ldscript
+++ b/arch/arm/lpc17xx/ldscript
@@ -36,6 +36,7 @@ MEMORY
*/
EXTERN(__cs3_reset_cortex_m)
EXTERN(__cs3_interrupt_vector_cortex_m)
+EXTERN(__cs3_interrupt_vector_cortex_m_mutable)
EXTERN(__cs3_start_c main __cs3_stack __cs3_stack_size __cs3_heap_end)
PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
@@ -67,19 +68,27 @@ SECTIONS
*(.rom)
*(.rom.b)
- __cs3_reset = __cs3_reset_cortex_m;
- *(.cs3.reset)
- /* Make sure we pulled in some reset code. */
- ASSERT (. != __cs3_reset, "No reset code");
-
*( .privileged_code )
*( privileged_functions )
- . = ALIGN(32);
+ __privileged_code_end___len = . - __privileged_code_start__ - 1 ;
+ __privileged_code_end___len |= __privileged_code_end___len >> 1 ;
+ __privileged_code_end___len |= __privileged_code_end___len >> 2 ;
+ __privileged_code_end___len |= __privileged_code_end___len >> 4 ;
+ __privileged_code_end___len |= __privileged_code_end___len >> 8 ;
+ __privileged_code_end___len |= __privileged_code_end___len >> 16 ;
+ . = ALIGN( MAX( __privileged_code_end___len + 1, 32 ) ) ;
__privileged_code_end__ = .;
__privileged_functions_end__ = .;
+ __cs3_reset = __cs3_reset_cortex_m;
+ *(.cs3.reset)
+ /* Make sure we pulled in some reset code. */
+ ASSERT (. != __cs3_reset, "No reset code");
+
+ *(.handlers)
+
*(.text .text.* .gnu.linkonce.t.*)
*(.plt)
*(.gnu.warning)
@@ -152,18 +161,28 @@ SECTIONS
.data_begin :
{
- . = ALIGN(8);
+ . = ALIGN(32);
__rom_data_begin = .;
} > rom
.data :
{
- . = ALIGN(32);
__cs3_region_start_ram = .;
__ram_data_begin = .;
__privileged_data_start__ = .;
+ __cs3_interrupt_vector_mutable = __cs3_interrupt_vector_cortex_m_mutable;
+ *(.cs3.interrupt_vector_mutable)
+ /* Make sure we pulled in an interrupt vector. */
+ ASSERT (. != __cs3_interrupt_vector_cortex_m_mutable, "No interrupt vector");
*( privileged_data )
- . = ALIGN(32);
+
+ __privileged_data_end___len = . - __privileged_data_start__ - 1 ;
+ __privileged_data_end___len |= __privileged_data_end___len >> 1 ;
+ __privileged_data_end___len |= __privileged_data_end___len >> 2 ;
+ __privileged_data_end___len |= __privileged_data_end___len >> 4 ;
+ __privileged_data_end___len |= __privileged_data_end___len >> 8 ;
+ __privileged_data_end___len |= __privileged_data_end___len >> 16 ;
+ . = ALIGN( MAX( __privileged_data_end___len + 1, 32 ) ) ;
__privileged_data_end__ = .;
*(.cs3.region-head.ram)