bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: John.Adriaan
Subject: ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols
Date: Fri, 24 Jan 2020 15:34:45 +1100

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

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]