public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/29811] New: extern array declaration following by its definition reports different sizes in DWARF vs CTF
@ 2022-11-21  4:09 guillermo.e.martinez at oracle dot com
  2022-12-21 16:02 ` Dodji Seketeli
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: guillermo.e.martinez at oracle dot com @ 2022-11-21  4:09 UTC (permalink / raw)
  To: libabigail

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-01-01 17:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21  4:09 [Bug default/29811] New: extern array declaration following by its definition reports different sizes in DWARF vs CTF guillermo.e.martinez at oracle dot com
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

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).