]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ctf: handle DW_AT_specification
authorNick Alcock <nick.alcock@oracle.com>
Mon, 3 Jul 2017 17:22:36 +0000 (18:22 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 18 Sep 2017 21:31:29 +0000 (22:31 +0100)
commit8fddb1c9e610a566715575511a29e3e4725f0d2c
tree5ac4d155bb921f8263ba0f199a6f787c42c7fd8c
parent653646c18333c734986db09affa7249c989375a3
ctf: handle DW_AT_specification

Newer compilers (GCC 5+ in particular) save space in DWARF 2 debug info by
generating copious DW_AT_specification attributes linking uses to
declarations, allowing them to elide names (among other things). (However, it
looks like earlier GCCs might emit the attribute too, if less often.)

dwarf2ctf does not understand this attribute, leading to a kernel compilation
failure with much screaming like this:

init/main.c:113:early_boot_irqs_disabled: assemble_ctf_variable: 14c22:
skipping type, name attribute not present.
init/main.c:115:system_state: assemble_ctf_variable: 14c33: skipping type,
name attribute not present.
init/main.c:126:late_time_init: assemble_ctf_variable: 14cac: skipping type,
name attribute not present.
init/main.c:129:boot_command_line: assemble_ctf_variable: 14cbd: skipping
type, name attribute not present.
init/main.c:131:saved_command_line: assemble_ctf_variable: 14cce: skipping
type, name attribute not present.

Adding support for it is not hard: we just need to wrap most calls to
dwarf_hasattr() and dwarf_attr() to chase DW_AT_specification if need
be.  (The only things that should not be wrapped are calls inside the
wrappers themselves, and any lookups of DW_AT_declaration, which is
always set in the DIE referenced by DW_AT_specification even if it is
not considered set in the referee.)

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
Orabug: 26386100
scripts/dwarf2ctf/dwarf2ctf.c