Linker script PROVIDE statements
Nathan Sidwell
nathan@codesourcery.com
Fri Feb 20 17:06:00 GMT 2004
Alan Modra wrote:
> No. The point of PROVIDE is to only create the symbol if it is
> referenced. Try changing ldexp.c:fold_name to create an undefined
> symbol.
Oh, yeah, I'd missed that bit in the manual. Thanks for suggesting an
alternative.
Simply creating an undefined symbol in fold_name is insufficient. We
need to cause the name to be folded earlier on, hence the tweak in
lang_size_sections_1 wrt data statements. Unfortunately, doing that
folding causes LONG (SIZEOF (section)) to fail if 'section' is forward
referenced. Thus the removal of 'check' and its error message from
fold_name (whilst there I tidied up 'invalid'). I changed the error
message in lang_size_sections_1, to cover the cases that check would
have done so. Also, whilst there I made 'processed' tri-valued so that
one can write
section LOADADDR (section) + ${OFFSET} : AT (someexpr) {...}
which I'd find slightly more convenient when laying down ROM images.
tested on i686-pc-linux-gnu, ok? Or let me know if you'd like it splitting
up into a preparatory patch dealing with just the check, invalid and
processed field reworking, followed by a second one to do the PROVIDE stuff.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: provide-3.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20040220/370a248a/attachment.ksh>
More information about the Binutils
mailing list