OpenCores
no use no use 1/1 no use no use
Issue with link.ld file in FreeRTOS.
by avamsi on May 12, 2012
avamsi
Posts: 54
Joined: Apr 16, 2012
Last seen: Jul 30, 2014
Hi,
I was able to build and run the sample code on FreeRTOS when I used the provided link.ld file. There in that file, only RAM space was earmarked for all the sections (.text,.rodata,.icm,.data,.bss). That was fine and working. But when I modified the file like below(rom and ram both are RAM locations only), it is giving following errors.

vectors : ORIGIN = 0x00000000, LENGTH = 0x00001100
rom : ORIGIN = 0x00001200, LENGTH = 0x00060000 - 0x00001200
ram : ORIGIN = 0x00070000, LENGTH = 0x00080000 - 0x00070000
}

SECTIONS
{
.vectors :
{
_vec_start = .;
*(.vectors)
_vec_end = .;
} > vectors

.text ALIGN(4) :
{
*(.text)
} > rom

.rodata ALIGN(4) :
{
*(.rodata)
*(.rodata.*)
} > rom

.icm ALIGN(4) :
{
_icm_start = .;
*(.icm)
_icm_end = .;
} > rom

.data ALIGN(4) :
{
_dst_beg = .;
*(.data)
_dst_end = .;
} > ram

.bss ALIGN(4) :
{
_bss_beg = .;
*(.bss)
_bss_end = .;
} > ram

PROVIDE(_stack_top = 0x00090000);
}
Error is ::
avamsi@avamsi01:~/OpenRISC/FreeRTOS/freertos-openrisc/FreeRTOSV6.1.1/Demo/OpenRISC_SIM_GCC$ make
make[1]: Entering directory `/home/avamsi/OpenRISC/FreeRTOS/freertos-openrisc/FreeRTOSV6.1.1/Demo/OpenRISC_SIM_GCC/arch'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/avamsi/OpenRISC/FreeRTOS/freertos-openrisc/FreeRTOSV6.1.1/Demo/OpenRISC_SIM_GCC/arch'
make[1]: Entering directory `/home/avamsi/OpenRISC/FreeRTOS/freertos-openrisc/FreeRTOSV6.1.1/Demo/OpenRISC_SIM_GCC/drivers'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/avamsi/OpenRISC/FreeRTOS/freertos-openrisc/FreeRTOSV6.1.1/Demo/OpenRISC_SIM_GCC/drivers'
Link....
or32-elf-ld: address 0x1760 of rtosdemo.or32 section `.data' is not within region `ram'
or32-elf-ld: address 0x1860 of rtosdemo.or32 section `.bss' is not within region `ram'
or32-elf-ld: address 0x1760 of rtosdemo.or32 section `.data' is not within region `ram'
or32-elf-ld: address 0x1860 of rtosdemo.or32 section `.bss' is not within region `ram'
make: *** [rtosdemo.or32] Error 1
avamsi@avamsi01:~/OpenRISC/FreeRTOS/freertos-openrisc/FreeRTOSV6.1.1/Demo/OpenRISC_SIM_GCC$

When I looked into the generated map file, all the code sections have occupied contiguous locations(0x00000000-0x00001760). What ever I mentioned for .data and .bss were not full-filled. Do we have to make use the same link.ld file or can we modify like I did.

Thanks,
A.Vamsi
no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.