Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols

0 views
Skip to first unread message

John.A...@bigpond.com

unread,
Dec 23, 2019, 8:18:04 AM12/23/19
to Bug-GN...@gnu.org
REF: GNU ld (GNU Tools for Arm Embedded Processors 8-2019-q3-update)
2.32.0.20190703

HOST: Microsoft Windows [Version 10.0.18362.535]



Given the following definitions in a linker script:



_Page = DEFINED(_Spansion) ? 0x200 : 0x0100; /* Spansion has larger pages
*/

_Type = DEFINED(_Spansion) ? 0x53 : 0x46; /* 'S'pansion or 'F'lash */

_Rsvd = DEFINED(_DEBUG) ? 0x52737664 : ~0; /* Literally "Rsvd" */



Then the following lines all work:



. = ALIGN(_Page);

BYTE(_Type);

FILL(0x52737664);

FILL(0x52<<24 | 0x73<<16 | 0x76<<8 | 0x64<<0); /* Complicated expression! */

.section : { } >rom = 0x52737664



However, either of the following lines crash the linker:



FILL(_Rsvd);

.section : { } >rom = _Rsvd



Even if I simplify the definition to:



_Rsvd = 0x52737664; /* Literally "Rsvd" */



I still get the same errors.



These give (depending on which manufacturer's Eclipse IDE I use) either:



collect2.exe: error: ld returned 5 exit status (regardless of whether I
select "-Wl,--verbose" or not)

or

arm-none-eabi/bin/ld.exe: bfd_link_hash_lookup failed: no error (It's the
"no error" part that I like the most!)



It seems like the Fill algorithm doesn't like to use symbols.



Thanks for any feedback on this,



John Adriaan

0 new messages