Groups | Search | Server Info | Login | Register


Groups > gnu.utils.bug > #2270

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

From <John.Adriaan@BigPond.com>
Newsgroups gnu.utils.bug
Subject ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols
Date 2019-12-23 23:28 +1100
Message-ID <mailman.1306.1577107079.1979.bug-gnu-utils@gnu.org> (permalink)
References <012401d5b98c$87d99000$978cb000$@BigPond.com>

Show all headers | View raw


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

Back to gnu.utils.bug | Previous | Next | Find similar


Thread

ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols <John.Adriaan@BigPond.com> - 2019-12-23 23:28 +1100

csiph-web