This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
loadaddr forward ref problem
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 01 Mar 2007 14:03:10 +0000
- Subject: loadaddr forward ref problem
Should we accept the following linker script?
SECTIONS
{
.text :
{
_start = .;
LONG (__data_load)
}
.data :
{
__data_load = LOADADDR (.data);
}
}
currently, this will fail with
nathan@kosh:4>ld/ld-new -T 1263.ld 1263.o
1263.ld:21: undefined symbol `__data_load' referenced in expression
The reason for this failure is that during lang_size_sections_1, we have an
undefined lma (os->processed_lma is FALSE). Thus when sizing sections, the
__data_load assignment always fails because LOADADDR is undefined. When we do
the single final pass, __data_load has no assigned value.
The linker script can be made to work by moving the __data_load assignment
outside of the .data section. Is that the right way to handle this issue?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk