0

I have a project using the RL78/L13 (R5F10WLE) device.

Compiler options:

-Wa,-adlhn=”$(basename $(notdir $<)).lst” -nostdinc -I”C:\PROGRA~2\GCCFOR~1.201\rl78-elf\rl78-elf/rl78-elf/optlibinc” -Wstack-usage=512 -mg13 -g3 -g

Assembler options:

-I”C:\Development\Projects\Comet\IHD\Firmware (E2STUDIO)\IHD_Comet/src” -adlhn=”$(basename $(notdir $<)).lis” –gdwarf2

Linker options:

-T”C:\Development\Projects\Comet\IHD\Firmware (E2STUDIO)\IHD_Comet\HardwareDebug\IHD_Comet_HardwareDebug_auto.gsi” @”C:\Development\Projects\Comet\IHD\Firmware (E2STUDIO)\IHD_Comet\HardwareDebug\LinkerSubCommand.tmp” -M=IHD_Comet.map -L”C:\PROGRA~2\GCCFOR~1.201\rl78-elf\rl78-elf/lib/gcc/rl78-elf/4.9.2.201701-GNURL78/g13″ -L”C:\PROGRA~2\GCCFOR~1.201\rl78-elf\rl78-elf/rl78-elf/lib/g13″ –start-group -loptm -loptc -lgcc –end-group -e_PowerON_Reset

I am getting these linker errors when I build the project. I need some guidance on how to go about resolving these linker errors?

rl78-elf-ld: address 0xff3c of IHD_Comet.x section `.text’ is not within region `ROM’
rl78-elf-ld: address 0x105aa of IHD_Comet.x section `.rodata’ is not within region `ROM’
rl78-elf-ld: address 0xff3c of IHD_Comet.x section `.text’ is not within region `ROM’
rl78-elf-ld: address 0x105aa of IHD_Comet.x section `.rodata’ is not within region `ROM’

An export of my linker sections is below:

MEMORY
{
VEC : ORIGIN = 0x0, LENGTH = 4
IVEC : ORIGIN = 0x4, LENGTH = 188
OPT : ORIGIN = 0xC0, LENGTH = 4
SEC_ID : ORIGIN = 0xC4, LENGTH = 10
OCDSTAD : ORIGIN = 0xCE, LENGTH = 10
OCDROM : ORIGIN = 0xFE00, LENGTH = 512
ROM : ORIGIN = 0xD8, LENGTH = 64808
MIRROR : ORIGIN = 0xF2000, LENGTH = 52991
RAM : ORIGIN = 0xFEF00, LENGTH = 4095
}

SECTIONS
{
.vec 0x0 : AT (0x0)
{
KEEP(*(.vec))
} > VEC
.vects 0x4 : AT (0x4)
{
KEEP(*(.vects))
} > IVEC
.option_bytes 0xC0 : AT (0xC0)
{
KEEP(*(.option_bytes))
} > OPT
.security_id 0xC4 : AT (0xC4)
{
KEEP(*(.security_id))
} > SEC_ID
.lowtext 0xD8 : AT (0xD8)
{
*(.plt)
*(.lowtext)
. = ALIGN(2);
} > ROM
.tors :
{
__CTOR_LIST__ = .;
. = ALIGN(2);
___ctors = .;
*(.ctors)
___ctors_end = .;
__CTOR_END__ = .;
__DTOR_LIST__ = .;
___dtors = .;
*(.dtors)
___dtors_end = .;
__DTOR_END__ = .;
_mdata = .;
} > ROM
.text (. + __romdatacopysize) :
{
*(.text)
*(.text.*)
etext = .;
. = ALIGN(2);
} > ROM

PROVIDE (__rl78_abs__ = 0);

.init :
{
*(.init)
} > ROM
.fini :
{
*(.fini)
} > ROM
.got :
{
*(.got)
*(.got.plt)
} > ROM
.rodata MAX(., 0x2000) :
{
. = ALIGN(2);
*(.rodata)
*(.rodata.*)
_erodata = .;
} > ROM
.frodata :
{
} > ROM
.eh_frame_hdr :
{
*(.eh_frame_hdr)
} > ROM
.eh_frame :
{
*(.eh_frame)
} > ROM
.jcr :
{
*(.jcr)
. = ALIGN(2);
} > ROM
.data 0xFEF00 : AT (_mdata)
{
. = ALIGN(2);
_data = .;
*(.data)
*(.data.*)
. = ALIGN(2);
_edata = .;
} > RAM

PROVIDE (__romdatacopysize = SIZEOF(.data));

.bss :
{
. = ALIGN(2);
_bss = .;
*(.bss)
*(.bss.**)
. = ALIGN(2);
*(COMMON)
. = ALIGN(2);
_ebss = .;
_end = .;
} > RAM

PROVIDE (stack_size = 0x200);

.stack 0xFFEDC (NOLOAD) : AT (0xFFEDC)
{
_stack = .;
ASSERT ((_stack > (_end + stack_size)),”Error: Too much data – no room left for the stack”);
} > RAM
}

Darius Galis answered