Hi,
I am migrating code to the new f2418 on the first section of the memory.
I am not too familiar with linker files and now the program reboots each
time it hits an instruction.
The instruction is
757e: b0 12 00 0c call #3072 ;#0x0c00
Which call a function in the boot memory.
Can someone explain why libgcc is placed at 0c00?
00000c00 l d .text.libgcc 00000000 .text.libgcc
(00000c00 g .text.libgcc 00000000 __umulsi3hw)
Here is my linker file :
OUTPUT_FORMAT("elf32-msp430","elf32-msp430","elf32-msp430")
OUTPUT_ARCH(msp:241)
MEMORY
{
bootloader (rx) : ORIGIN = 0x0C00, LENGTH = 0x0400
infomem (rx) : ORIGIN = 0x1000, LENGTH = 0x0100
infomemnobits (rx) : ORIGIN = 0x1000, LENGTH = 0x0100
infomemB (rx) : ORIGIN = 0x1000, LENGTH = 0x0040
infoApp (rx) : ORIGIN = 0x1040, LENGTH = 0x0040
infomemA (rx) : ORIGIN = 0x1080, LENGTH = 0x0040
infomemC (rx) : ORIGIN = 0x10C0, LENGTH = 0x0040
data (rwx) : ORIGIN = 0x1100, LENGTH = 0x1400
downloader (rx) : ORIGIN = 0x2500, LENGTH = 0x0c00
text (rx) : ORIGIN = 0x3100, LENGTH = 0xcfe0
vectors (rw) : ORIGIN = 0xFFC0, LENGTH = 0x0040
}
SECTIONS
{
. . .
/* Internal text space. */
.text :
{
. . .
_etext = .;
} > text
.data :
{
PROVIDE (__data_start = .) ;
. = ALIGN(2);
*(.data)
*(SORT_BY_ALIGNMENT(.data.*))
. = ALIGN(2);
*(.gnu.linkonce.d*)
. = ALIGN(2);
_edata = . ;
} > data AT > text
PROVIDE (__data_load_start = LOADADDR(.data) );
PROVIDE (__data_size = SIZEOF(.data) );
.downloader :
{
PROVIDE (__downloader_start = .) ;
. = ALIGN(2);
*(.downloader)
. = ALIGN(2);
PROVIDE (__downloader_end = .) ;
} > downloader
/* Bootloader. */
.bootloader :
{
PROVIDE (__boot_start = .) ;
*(.bootloader)
. = ALIGN(2);
*(.bootloader.*)
} > bootloader
/* Information memory. */
.infomem :
{
*(.infomem)
. = ALIGN(2);
*(.infomem.*)
} > infomem
/* Information memory (not loaded into MPU). */
.infomemnobits :
{
*(.infomemnobits)
. = ALIGN(2);
*(.infomemnobits.*)
} > infomemnobits
.infomemB :
{
. = ALIGN(2);
PROVIDE (__infomemB_start = .) ;
*(.infomemB)
. = ALIGN(2);
PROVIDE (__infomemB_end = .) ;
} > infomemB
.infomemA :
{
. = ALIGN(2);
PROVIDE (__infomemA_start = .) ;
*(.infomemA)
. = ALIGN(2);
PROVIDE (__infomemA_end = .) ;
} > infomemA
.infomemC :
{
. = ALIGN(2);
PROVIDE (__infomemC_start = .) ;
*(.infomemC)
. = ALIGN(2);
PROVIDE (__infomemC_end = .) ;
} > infomemC
.infoApp :
{
. = ALIGN(2);
PROVIDE (__infoApp_start = .) ;
*(.infoApp)
. = ALIGN(2);
PROVIDE (__infoApp_end = .) ;
} > infoApp
.bss SIZEOF(.data) + ADDR(.data) :
{
PROVIDE (__bss_start = .) ;
*(.bss)
*(SORT_BY_ALIGNMENT(.bss.*))
*(COMMON)
PROVIDE (__bss_end = .) ;
_end = . ;
} > data
PROVIDE (__bss_size = SIZEOF(.bss) );
.noinit :
{
PROVIDE (__noinit_start = .) ;
*(.noinit)
*(.noinit.*)
*(COMMON)
PROVIDE (__noinit_end = .) ;
_end = . ;
} > data
.vectors :
{
PROVIDE (__vectors_start = .) ;
*(.vectors*)
KEEP(*(.vectors*))
_vectors_end = . ;
} > vectors
/* Stabs for profiling information*/
.profiler 0 : { *(.profiler) }
. . .
}
Thanks,
AL