https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97669
Bug ID: 97669
Summary: Section .debug_info.dwo contains
standard_opcode_lenghts array
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
In the dwarf v5 standard we read:
...
.debug_line.dwo - Contains specialized line number tables for the type
units in the .debug_info.dwo section. These tables contain only the
directory and filename lists needed to interpret DW_AT_decl_file attributes
in the debugging information entries. Actual line number tables remain in
the .debug_line section, and remain in the relocatable object (.o) files.
...
Now consider:
...
$ gcc-11 \
-g -gsplit-dwarf \
~/hello.c \
-v -save-temps \
-dA
...
In file hello.s, in section .debug_line.dwo, we have the
standard_opcode_lenghts array:
...
.byte 0xd # Special Opcode Base
.byte 0 # opcode: 0x1 has 0 args
.byte 0x1 # opcode: 0x2 has 1 args
.byte 0x1 # opcode: 0x3 has 1 args
.byte 0x1 # opcode: 0x4 has 1 args
.byte 0x1 # opcode: 0x5 has 1 args
.byte 0 # opcode: 0x6 has 0 args
.byte 0 # opcode: 0x7 has 0 args
.byte 0 # opcode: 0x8 has 0 args
.byte 0x1 # opcode: 0x9 has 1 args
.byte 0 # opcode: 0xa has 0 args
.byte 0 # opcode: 0xb has 0 args
.byte 0x1 # opcode: 0xc has 1 args
...
But given that this is a "specialized line number table", there's no line
number program, and because of that, the standard_opcode_lengths array is
unnecessary.
[ And then there's the fact that actually the whole .debug_line.dwo is
unnecessary, given that there are no type units in .debug_info.dwo. ]