]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ctf: handle the bit_offset in members with a DW_FORM_block data_member_location
authorNick Alcock <nick.alcock@oracle.com>
Tue, 4 Jul 2017 00:09:01 +0000 (01:09 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 18 Sep 2017 21:31:29 +0000 (22:31 +0100)
commit77c57a8ad70e4052a986d3dc76f30de7c3f03393
tree9a50e74e6b0864dc47951baeeaee0767d46863d6
parent8fddb1c9e610a566715575511a29e3e4725f0d2c
ctf: handle the bit_offset in members with a DW_FORM_block data_member_location

When building a SPARC kernel with GCC 6, the following failure is observed at
CTF generation time:

Internal error: within file arch/sparc/built-in.o, module vmlinux, type at
DIE offset 3fe447 with ID ////unsigned int:23:0  was not already noted by
detect_duplicates().

This is because the bit-field in question
(include/math-emu/single.h:_FP_UNION_S.frac) is at offset 1, not 0: the type
ID being emitted should be ////unsigned int:23:1.  We are not correctly
handling the case where a bit-field at nonzero offset has its
data_member_location represented by a DW_FORM_block: we were erroneously only
considering the bit offset when the form was DW_FORM_*data* (i.e. a simple
constant), because I assumed that in this situation the
DW_AT_data_member_location would track the location at bit granularity.
This is obviously wrong: no matter what form it's in, the
data_member_location is a count of bytes.  It can't suddenly turn into a
count of bits just because it's not being represented as a simple
constant!

So promote the bit-offset handling to apply to all
data_member_locations, regardless of form.

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