This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
linker script symbol reference
- From: Constantine Kousoulos <wuwei at freemail dot gr>
- To: binutils at sourceware dot org
- Date: Tue, 03 Apr 2007 10:49:37 +0300
- Subject: 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