bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/28217] New: Syntax error when memory region contains a hyp


From: sebastiaan.de.schaetzen at gmail dot com
Subject: [Bug binutils/28217] New: Syntax error when memory region contains a hyphen
Date: Tue, 10 Aug 2021 06:10:40 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28217

            Bug ID: 28217
           Summary: Syntax error when memory region contains a hyphen
           Product: binutils
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: sebastiaan.de.schaetzen at gmail dot com
  Target Milestone: ---

I've recently upgraded from binutils 2.36.1 to version 2.37.
This has now caused some of the firmware code I'm working on to no
longer compile.
The firmware uses RIOT OS, and its linker script uses minus ("-")
symbols in some of its region names.
(specifically, it has a region called "bkup-ram" allowing one to store
data in special backup memory if the
microcontroller has it).

While this used to work, it now throws a syntax error

/usr/lib/gcc/arm-none-eabi/11.2.0/../../../../arm-none-eabi/bin/ld:cortexm_base.ld:215:
warning: memory region `bkup' not declared
/usr/lib/gcc/arm-none-eabi/11.2.0/../../../../arm-none-eabi/bin/ld:cortexm_base.ld:215:
syntax error
collect2: error: ld returned 1 exit status

Some of the relevant lines in cortexm_base.ld:
     40 /* not all Cortex-M platforms use cortexm.ld yet */
     41 MEMORY
     42 {
     43     bkup-ram (w!rx) : ORIGIN = _backup_ram_start_addr, LENGTH
= _backup_ram_len
     44 }

    208     _sbackup_data_load = LOADADDR(.backup.data);
    209     .backup.data :  ALIGN(4) {
    210         _sbackup_data = .;
    211         *(.backup.data)
    212         _ebackup_data = .;
    213         /* Round size so that we can use 4 byte copy in init */
    214         . = ALIGN(4);
    215     } > bkup-ram AT> rom

Renaming bkup-ram to bkup_ram fixes the issue.

Is this a regression in 2.37, or was it a bug that 2.36.1 even
accepted it in the first place?

-- 
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]