dwarves_reorganize: Fix member type fixup

See the patch itself for the explanation.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2013-08-15 14:56:22 -03:00
parent e31fda3063
commit c4ccdd5ae6
1 changed files with 23 additions and 1 deletions

View File

@ -738,7 +738,29 @@ static void class__fixup_member_types(struct class *class, const struct cu *cu,
const uint16_t real_size = (pos->byte_offset -
bitfield_head->byte_offset);
const size_t size = bitfield_head->byte_size;
if (real_size != size) {
/*
* Another case:
struct irq_cfg {
struct irq_pin_list * irq_2_pin; / * 0 8 * /
cpumask_var_t domain; / * 8 16 * /
cpumask_var_t old_domain; / * 24 16 * /
u8 vector; / * 40 1 * /
u8 move_in_progress:1; / * 41: 7 1 * /
u8 remapped:1; / * 41: 6 1 * /
/ * XXX 6 bits hole, try to pack * /
/ * XXX 6 bytes hole, try to pack * /
union {
struct irq_2_iommu irq_2_iommu; / * 16 * /
struct irq_2_irte irq_2_irte; / * 4 * /
}; / * 48 16 * /
/ * --- cacheline 1 boundary (64 bytes) --- * /
* So just fix it up if the byte_size of the bitfield is
* greater than what it really uses.
*/
if (real_size < size) {
uint16_t new_type_id;
struct tag *new_type_tag =
cu__find_base_type_of_size(cu,