trouble with INCLUDE in linker command files

Guy.McCarthy@microchip.com Guy.McCarthy@microchip.com
Tue Oct 16 15:16:00 GMT 2001


Hello,

There appears to be a bug in ld having to do with INCLUDE in linker 
command files. I am using binutils v2.11.2 with a target of 
i386-pc-cygwin.

If a file called "provides.lkr" includes the single line:
PROVIDE(WREG0     = 0x00);

And ld is invoked like this:
ld --script=sample.lkr

The following error message is printed:
ld:sample.lkr:15: syntax error

If the INCLUDE command is removed, the linker script parses just fine. 
Curiously, the MAX expression seems to trigger the problem.

This test case was boiled down from a much larger file that really needs 
INCLUDE.

Any suggestions?

Thanks in advance,

Guy McCarthy
guy.mccarthy@microchip.com


MEMORY
{
  program (rx) : ORIGIN = 0,    LENGTH = 0x8000
  data  (!rx)  : ORIGIN = 0,    LENGTH = 0x8000
}

INCLUDE provides.lkr

SECTIONS
{
.text ALIGN(4) :
  {
        *(.text);
  } >program

.bss ALIGN(2) :
  {
        *(.bss);
  } >data

.ybss MAX( 0x3000 , ALIGN(2)) :
  {
        *(.ybss);
  } >data
}




More information about the Binutils mailing list