[riot-notifications] [RIOT-OS/RIOT] cpu/avr8_common: Fix link with binutils > 2.35.2 (#16790)

Marian Buschsieweke notifications at github.com
Tue Sep 28 17:22:23 CEST 2021


Are you sure that there is value in adding that section? The horribly outdated toolchain in `riot/riotbuild` indeed also has a section for the `user_signatures` memory area:

```ld
SECTIONS
{
  [...]
    .user_signatures  :
  {
    KEEP(*(.user_signatures*))
  }  > user_signatures
  [...]
}
```

But this section has been dropped in upstream, either for a reason or by accident. In any case, no code in RIOT is providing any symbols that get linked into that section and the section is empty, even when using `BUILD_IN_DOCKER=1`:

```
$ avr-readelf -S bin/atxmega-a1u-xpro/default.elf 
There are 19 section headers, starting at offset 0x93348:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000094 004064 00  AX  0   0  2
  [ 2] .data             PROGBITS        00802000 0040f8 000bf8 00  WA  0   0  1
  [ 3] .bss              NOBITS          00802bf8 004cf0 0004b1 00  WA  0   0  1
  [ 4] .noinit           NOBITS          008030a9 004cf0 000002 00  WA  0   0  1
  [ 5] .comment          PROGBITS        00000000 004cf0 000011 01  MS  0   0  1
  [ 6] .note.gnu.av[...] NOTE            00000000 004d04 000040 00      0   0  4
  [ 7] .debug_aranges    PROGBITS        00000000 004d44 000960 00      0   0  1
  [ 8] .debug_info       PROGBITS        00000000 0056a4 01b585 00      0   0  1
  [ 9] .debug_abbrev     PROGBITS        00000000 020c29 008a70 00      0   0  1
  [10] .debug_line       PROGBITS        00000000 029699 00b01c 00      0   0  1
  [11] .debug_frame      PROGBITS        00000000 0346b8 00201c 00      0   0  4
  [12] .debug_str        PROGBITS        00000000 0366d4 028bd2 00      0   0  1
  [13] .debug_loc        PROGBITS        00000000 05f2a6 009aa4 00      0   0  1
  [14] .debug_ranges     PROGBITS        00000000 068d4a 0008e8 00      0   0  1
  [15] .debug_macro      PROGBITS        00000000 069632 0254a2 00      0   0  1
  [16] .shstrtab         STRTAB          00000000 09327d 0000c9 00      0   0  1
  [17] .symtab           SYMTAB          00000000 08ead4 0034e0 10     18 556  4
  [18] .strtab           STRTAB          00000000 091fb4 0012c9 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), p (processor specific)
```

So adding that section will - with the current code in RIOT - not change the ELF file in any way.

I also think it does make sense that upstream dropped it. The user signature seems to be something that you don't want to flash together with your firmware, but rather once during commissioning. Not having the section might prevent some mistakes from happening here.

But in any case: Since the ld scripts are an exact copy of the upstream version (except for the XFA addition and the deduplication), this is IMO unrelated to the PR. That section has also not been present for quite a few release, so any code relying on this will already be broken in `master` for many RIOT users.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16790#issuecomment-929333100
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210928/aaab8cdb/attachment.htm>


More information about the notifications mailing list