This is the mail archive of the binutils@sourceware.org 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]

linker script symbol reference


Hello,

I'm using a linker script that includes one section with output section
descriptions like this one:

  .data ALIGN(4) : AT(ADDR(.data) - offset)
  {
    _data = .;
    *(.data)
    _edata = .;
  }

I try to reference the defined symbols in my C files by defining

line 1: extern int _data, _edata;
line 2: vm_offset_t kdata = (vm_offset_t)&_data;
line 3: vm_offset_t kedata = (vm_offset_t)&_edata;

The type of vm_offset is an unsigned int.

When i try to build my project on an i386 machine, everything compiles
alright. When i try to build it on an amd64 machine, i get the following
errors:

line 2: error: initializer element is not constant
line 3: error: initializer element is not constant

I must be missing something. Can anybody please help?

Constantine


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