I tried LPCXpresso v3.6.3 (should be very similar to RedSuite as stated in demo name).
E:lpcxpresso_3.6.3_317Toolsbin>arm-none-eabi-gcc.exe --version
arm-none-eabi-gcc.exe (Code Red/Red Suite/2009_01_C) 4.3.3
...
Here is the fragment from RTOSDemo_RDB1768.map:
privileged_functions
0x00001798 0x5d4 ./src/FreeRTOS/portable/GCC/ARM_CM3_MPU/port.o
0x000018d8 xPortStartScheduler
0x00001990 xPortSysTickHandler
0x0000193c xPortPendSVHandler
0x00001930 vPortEndScheduler
0x00001810 vPortSVCHandler
0x00001798 pxPortInitialiseStack
0x00001b8c vPortStoreTaskMPUSettings
.text 0x00001d6c 0x51d6
0x00004000 . = (__privileged_functions_start__ + _Privileged_Functions_Region_Size)
*fill* 0x00001d6c 0x4000 00
*(.text*)
.text.Reset_Handler
0x00005d6c 0x84 ./src/cr_startup_lpc17.o
0x00005d6c Reset_Handler
0x00005d6c ResetISR
Look at .text section start address. It’s not 0x00004000, but shifted by 0x00004000 from end of privileged_functions section end.Location counter assignments in linker script such as
/* Non privileged code kept out of the first 16K or flash. */
. = __privileged_functions_start__ + _Privileged_Functions_Region_Size;
doesn’t work as expected.The same results with Yagarto GNU toolchain (arm-none-eabi-gcc.exe (GCC) 4.6.0).
Although some tutorials doesn’t recommend location counter assignments, GNU ld manual clearly describes this behavior and provides an example usage even.