public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "guillermo.e.martinez at oracle dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/29811] New: extern array declaration following by its definition reports different sizes in DWARF vs CTF
Date: Mon, 21 Nov 2022 04:09:59 +0000	[thread overview]
Message-ID: <bug-29811-9487@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29811

            Bug ID: 29811
           Summary: extern array declaration following by its definition
                    reports different sizes in DWARF vs CTF
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: guillermo.e.martinez at oracle dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

The following C code generates a infinite subrange length using DWARF
front-end.

extern unsigned int is_basic_table[];

unsigned int is_basic_table [] =
  {
    0,
  };

<array-type-def dimensions='1' type-id='type-id-1' size-in-bits='infinite'
alignment-in-bits='32' id='type-id-2'>
      <subrange length='infinite' type-id='type-id-3' id='type-id-4'/>
    </array-type-def>


Using CTF:

  <array-type-def dimensions='1' type-id='type-id-1' size-in-bits='32'
id='type-id-2'>
      <subrange length='1' type-id='type-id-3' id='type-id-4'/>
    </array-type-def>

Thus, abidiff abi-ctf.xml abi-dwarf.xml, reports:

1 Changed variable:                                                             

  [C] 'unsigned int is_basic_table[]' was changed at test-extern-array.c:3:1:   
    type of variable changed:                                                   
      array element type 'unsigned int' changed:                                
        type size hasn't changed                                                
        type alignment changed from 32 to 0                                     
      type size hasn't changed                                                  
      type alignment changed from 32 to 0

The symbol size showed by objdump:

  0000000000000000 g     O .bss   0000000000000004 is_basic_table

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-11-21  4:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  4:09 guillermo.e.martinez at oracle dot com [this message]
2022-12-21 16:02 ` Dodji Seketeli
2022-12-21 16:02 ` [Bug default/29811] " dodji at seketeli dot org
2022-12-22 10:17 ` dodji at redhat dot com
2022-12-22 15:27 ` guillermo.e.martinez at oracle dot com
2022-12-23  9:19   ` Dodji Seketeli
2022-12-23  9:19 ` dodji at seketeli dot org
2022-12-23  9:20 ` dodji at redhat dot com
2022-12-24 15:39 ` guillermo.e.martinez at oracle dot com
2023-01-01 17:50   ` Dodji Seketeli
2023-01-01 17:50 ` dodji at seketeli dot org
2023-01-01 17:57 ` dodji at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29811-9487@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).