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