This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .lnk file - parse error


Hi Bala,

> While using /opt/hardhat/devkit/ppc/405/bin/ppc_405-ld  
> I am getting parse errors when using the following link file.
> Any suggestions ?

Yes - read the description of the linker script language in the file
ld/ld.texinfo.  (You may prefer to read the processed version of this
file called 'ld.info').

Your example script contains many errors:

>         rom: org = 0x004000, len = 0x80000    <----- parse error

You need a space before the colon.

>             __DATA_ROM=.; <----- parse error

You need spaces around the equals sign.

>     } > rom; <------ parse error

The semicolon is illegal.

>     GROUP : {

The GROUP command does not work like this.



You may find that this rewritten version of your script will help.


MEMORY
{
  rom : org = 0x004000, len = 0x80000
  ram : org = 0x084000, len = 0x180000
}

SECTIONS
{
   .vectors : { *(.vectors) } > rom
   .text : { *(.text) *(.init) *(.fini) *(.eini) } > rom
   .sdata2 : { *(.sdata2) } > rom
    __DATA_ROM = .;

    .data  : AT (__DATA_ROM)
    {
        __DATA_RAM = .;
	*(.data)
    } > ram
    .sdata : AT (ADDR (.sdata) - ADDR (.data) + __DATA_ROM)
    {
	*(.sdata)
        __DATA_END = .;
    } > ram

    __BSS_START = .;
   .sbss  : { *(.sbss) } > ram
   .bss   : { *(.bss) } > ram
    __BSS_END = .;
}

__HEAP_START    = ADDR(ram);
__HEAP_END      = ADDR(ram)+SIZEOF(ram);
__SP_INIT       = __HEAP_END;
__SP_END        = __HEAP_START;
__VECTOR_BASE   = 0x0;
IIC0_BASE       = 0xEF600500;

___HEAP_START    = __HEAP_START;
___HEAP_END      = __HEAP_END;
___SP_INIT       = __SP_INIT;
___SP_END        = __SP_END;
___DATA_ROM      = __DATA_ROM;
___DATA_RAM      = __DATA_RAM;
___DATA_END      = __DATA_END;
___BSS_START     = __BSS_START;
___BSS_END       = __BSS_END;


Cheers
        Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]