division in ld scripts

Jan Beulich JBeulich@novell.com
Wed Sep 9 13:38:00 GMT 2009


Is it known/intended/documented that using the division operator (/) in
ld scripts requires a blank to follow, at least in some cases (see below)?
All other operators seem to behave as expected (apart from the missing
but unlikely to be needed ^), while / results in a "syntax error" failure.

Thanks, Jan

OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(test)
PHDRS
{
  text PT_LOAD ;
}
SECTIONS
{
  . = 0x00401000+2;
  . = 0x00401000-2;
  . = 0x00401000*2;
  . = 0x00401000/2;
  . = 0x00401000%2;
  . = 0x00401000&2;
  . = 0x00401000|2;
/*  . = 0x00401000^2;*/
  .text : {
        _stext = .;
       *(.text)
       *(.gnu.warning)
       _etext = .;
  } :text = 0x9090
  .rodata : {
       *(.rodata)
       *(.rodata.*)
  } :text
  .data : {
       *(.data)
  } :text
  .bss : {
       *(.bss)
  } :text
  _end = . ;
}




More information about the Binutils mailing list