bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/4643] linker scripts do not accept symbols in MEMORY section


From: ingolf.steinbach at gmail dot com
Subject: [Bug ld/4643] linker scripts do not accept symbols in MEMORY section
Date: Wed, 12 Dec 2012 21:15:05 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=4643

Ingolf Steinbach <ingolf.steinbach at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ingolf.steinbach at gmail
                   |                            |dot com

--- Comment #4 from Ingolf Steinbach <ingolf.steinbach at gmail dot com> 
2012-12-12 21:15:05 UTC ---
(In reply to comment #3)
> The point is, I should be able to define a constant-valued symbol, e.g. 
> "mySym =
> 0x100;" *outside* (and before) the MEMORY command, then use the symbol (i.e. a
> meaningful name instead of a bare literal) inside the MEMORY command, *and* in
> logically related expressions in the rest of the script.

There used to be some workaround. You could define "constants" like this:
MEMORY
{
    _flash_start :
        ORIGIN = 0x10000,
        LENGTH = 0

    _flash_end :
        ORIGIN = 0x20000,
        LENGTH = 0
}

Later, you could use these "constants" like this:

MEMORY
{
    FLASH :
        ORIGIN = ORIGIN(_flash_start),
        LENGTH = ORIGIN(_flash_end) - ORIGIN(_flash_start)
}


This worked at least with binutils 2.18. With the current release (2.23.1),
even this workaround is forbidden and results in "nonconstant expression"
complaints. I'd consider this a regression. Maybe I'll file a new bug report
for this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

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