Error when using custom linker scripts

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Error when using custom linker scripts

492 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by anders@trebax on Wed Aug 18 09:21:01 MST 2010
[FONT=Arial][SIZE=2]Hi,

I have been looking at the AN10905 application note "USB mass storage class with the LPC1300 on-chip driver" and have followed the steps in chapter 3 on page 4 exactly; Built the project once, copied and edited the linker files, unchecked "Manage linker scripts" in the build options and directed the linker to use the new linker files.

When I now try to build the project I get the error message:[/SIZE][/FONT][SIZE=2]
[/SIZE][FONT=Courier New][SIZE=2]makefile:30: *** unterminated variable reference.  Stop.[/SIZE][/FONT][SIZE=2]

[/SIZE][FONT=Arial][SIZE=2]The linker files looks as follows:
[B]
myLinkerScript.ld:[/B][/SIZE][/FONT][SIZE=2]
[/SIZE][FONT=Courier New][SIZE=2]INCLUDE "myLinkerScript_lib.ld"
INCLUDE "[/SIZE][/FONT][FONT=Courier New][SIZE=2]myLinkerScript[/SIZE][/FONT][FONT=Courier New][SIZE=2]_mem.ld"
ENTRY(ResetISR)
SECTIONS
{
    .text :
    {
        KEEP(*(.isr_vector))
        *(.text*)
        *(.rodata*)

    } > MFlash32
    .ARM.extab : /* for exception handling/unwind - some Newlib functions (in common with C++ and STDC++) use this. */
    {
        *(.ARM.extab* .gnu.linkonce.armextab.*)
    } > MFlash32
    __exidx_start = .;
    .ARM.exidx :
    {
        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
    } > MFlash32
    __exidx_end = .;
    _etext = .;
    .data :
    {
        _data = .;
        *(vtable)
        *(.data*)
        _edata = .;
    } > RamLoc8 AT>MFlash32   [B]/* Line 30 */[/B]
    .bss : /* zero initialized data */
    {
        _bss = .;
        *(.bss*)
        *(COMMON)
        _ebss = .;
    } > RamLoc8
    .cr_heap : /* Where we put the heap with cr_clib */
    {
        end = .;
        _pvHeapStart = .;
    } > RamLoc8
    _vRamTop = __top_RamLoc8 ;
    _vStackTop = _vRamTop - 0;
}
[/SIZE][/FONT][FONT=Arial][SIZE=2]
[/SIZE][/FONT][FONT=Arial][SIZE=2][B]myLinkerScript_mem.ld:
[/B][FONT=Courier New]MEMORY
{
  /* Define each memory region */
  MFlash32 (rx) : ORIGIN = 0x0, LENGTH = 0x8000 /* 32k */
  RamLoc8 (rwx) : ORIGIN = 0x10000180, LENGTH = 0x1E80 /* ~8k */

}
  /* Define a symbol for the top of each memory region */
  __top_MFlash32 = 0x0 + 0x8000;
  __top_RamLoc8 = 0x10000000 + 0x2000;

[/FONT][/SIZE][/FONT][B][FONT=Arial][SIZE=2]myLinkerScript[/SIZE][/FONT][FONT=Arial][SIZE=2]_lib.ld:[/SIZE][/FONT][/B][SIZE=2]
[FONT=Courier New]GROUP(libcr_c.a libcr_nohost.a libcr_eabihelpers.a)
[FONT=Arial]
[/FONT][/FONT][/SIZE][SIZE=2][FONT=Courier New][FONT=Arial]Any idea why this happens?

[/FONT][/FONT][/SIZE][SIZE=2][FONT=Courier New][FONT=Arial]When building the project with managed linker scripts (which are almost identical to the ones above) it all works well.

The only changes made to the linker files are the RAM region in [/FONT][/FONT][/SIZE][FONT=Arial][SIZE=2]myLinkerScript_mem.ld [/SIZE][/FONT][SIZE=2][FONT=Courier New][FONT=Arial]and the search paths for the two additional linker scripts in myLinkerScript.ld. I haven't edited anywhere near line 30 in myLinkerScript.ld!
[/FONT][/FONT][FONT=Arial]My guess is that it has something to do with [B]AT[/B] and I don't understand where this variable gets set.

Best regards
/Anders
[/FONT] [/SIZE]
0 项奖励
回复
0 回复数