powerpc cross tools generate bogus string table

Bug #2077036 reported by Sergio Durigan Junior
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Invalid
High
Unassigned
gcc-14 (Ubuntu)
Invalid
Undecided
Unassigned
qemu (Ubuntu)
Fix Released
Undecided
Sergio Durigan Junior

Bug Description

I'm still not entirely sure whether this problem is caused by binutils or gcc-14, but my suspicion is that it's the former.

QEMU is being affected by this problem, as can be seen in the following build log:

https://launchpadlibrarian.net/743528322/buildlog_ubuntu-oracular-amd64.qemu_1%3A9.0.2+ds-2ubuntu1~ppa6_BUILDING.txt.gz

The interesting part is this one:

...
powerpc-linux-gnu-objcopy -O srec u-boot u-boot.srec
powerpc-linux-gnu-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
powerpc-linux-gnu-objcopy: warning: u-boot has a corrupt string table index
powerpc-linux-gnu-objcopy: unable to modify 'u-boot' due to errors
make[1]: *** [Makefile:300: u-boot.srec] Error 1
...

So far I have confirmed that using the previous versions of binutils (2.42.90.20240720-2ubuntu1) and gcc-14 (14.2.0-1ubuntu1) make the QEMU build work again.

Using powerpc-linux-gnu-readelf to compare the u-boot binary generated by the "good" binutils+gcc against the "bad" ones, I see:

Good binary:

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 fff80000 000080 046098 00 AX 0 0 16
  [ 2] .rodata PROGBITS fffc6098 046118 00b9f9 00 A 0 0 4
  [ 3] .reloc PROGBITS fffd1b00 051b80 003678 00 WA 0 0 4
  [ 4] .data PROGBITS fffd5178 0551f8 004c94 00 WA 0 0 4
  [ 5] .u_boot_cmd PROGBITS fffd9e0c 059e8c 0003d8 00 WA 0 0 4
  [ 6] .bootpg PROGBITS fffff000 07f080 0002bc 00 AX 0 0 1
  [ 7] .resetvec PROGBITS fffffffc 08007c 000004 00 AX 0 0 1
  [ 8] .bss NOBITS 00000100 080100 012ba0 00 WA 0 0 256
  [ 9] .debug_line PROGBITS 00000000 080080 045fed 00 0 0 1
  [10] .debug_line_str PROGBITS 00000000 0c606d 000100 01 MS 0 0 1
  [11] .debug_info PROGBITS 00000000 0c616d 084c69 00 0 0 1
  [12] .debug_abbrev PROGBITS 00000000 14add6 0167bc 00 0 0 1
  [13] .debug_aranges PROGBITS 00000000 161598 003820 00 0 0 8
  [14] .debug_str PROGBITS 00000000 164db8 00fb90 01 MS 0 0 1
  [15] .debug_rnglists PROGBITS 00000000 174948 005518 00 0 0 1
  [16] .debug_loclists PROGBITS 00000000 179e60 03b8d0 00 0 0 1
  [17] .comment PROGBITS 00000000 1b5730 000025 01 MS 0 0 1
  [18] .gnu.attributes GNU_ATTRIBUTES 00000000 1b5755 000010 00 0 0 1
  [19] .symtab SYMTAB 00000000 1b5768 007b40 10 20 537 4
  [20] .strtab STRTAB 00000000 1bd2a8 006d85 00 0 0 1
  [21] .shstrtab STRTAB 00000000 1c402d 0000e2 00 0 0 1

Bad binary:

Section Headers:
  [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
  [ 0] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 1] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 2] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 3] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 4] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 5] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 6] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 7] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 8] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [ 9] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [10] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [11] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [12] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [13] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [14] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [15] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [16] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [17] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [18] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [19] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [20] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [21] <no-strings> NULL 00000000 000000 000000 00 0 0 0
  [22] <no-strings> NULL 00000000 000000 000000 00 0 0 0

Tags: server-todo
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Adding gcc-14 as a task just in case.

Adding qemu as a task to make sure we track the impact of this bug.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I think I found the reason for this failure. I'm doing a test build and will post the results here soon.

tags: added: server-todo
Changed in qemu (Ubuntu):
assignee: nobody → Sergio Durigan Junior (sergiodj)
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

The problem was the new ELF_PACKAGE_METADATA interacting weirdly with the PPC cross linker. I don't exactly know why, and IMHO this shouldn't really happen, but I will mark this bug as Invalid for both gcc and binutils because it's fixed in QEMU.

Changed in qemu (Ubuntu):
status: New → Fix Committed
Changed in gcc-14 (Ubuntu):
status: New → Invalid
Changed in binutils (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu - 1:9.0.2+ds-4ubuntu2

---------------
qemu (1:9.0.2+ds-4ubuntu2) oracular; urgency=medium

  * d/rules: Reinstate u-boot-sam460ex rules.
  * d/rules: Unset ELF_PACKAGE_METADATA when building ROMs.
    (LP: #2077431, #2077036)

 -- Sergio Durigan Junior <email address hidden> Tue, 20 Aug 2024 22:40:20 -0400

Changed in qemu (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.