]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ctf: handle structure and union offsets in form DW_FORM_data1
authorNick Alcock <nick.alcock@oracle.com>
Thu, 23 Jan 2014 23:21:24 +0000 (23:21 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 21 Jul 2015 14:29:28 +0000 (15:29 +0100)
GCC 4.8.0 and above have started to represent structure member offsets in the
DW_AT_data_member_location attribute using DWARF forms DW_FORM_data1 and _data2
where possible: indeed, this is the common case, as most structure members are
less than 64K into the structure: and every structure contains at least one
member whose offset is represented this way.

dwarf2ctf neglected to check for DW_FORM_data1, so the build failed when it hit
the first structure in the kernel and realised that it didn't understand its
offset.

Fix trivial.

Orabug: 18117464
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Chuck Anderson <chuck.anderson@oracle.com>
scripts/dwarf2ctf/dwarf2ctf.c

index 3f1d41ef0dfdbb89b042d133708d042fb8bb6d65..445728cd9d45ab4b54e5d65b5ad8654bbd4ddec2 100644 (file)
@@ -3105,6 +3105,7 @@ static ctf_id_t assemble_ctf_su_member(const char *module_name,
                dwarf_attr(die, DW_AT_data_member_location, &location_attr);
 
                switch (dwarf_whatform(&location_attr)) {
+               case DW_FORM_data1:
                case DW_FORM_data2:
                case DW_FORM_data4:
                case DW_FORM_data8: