public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/29443] New: abidw loses declarations of global variables having the same name and type as a member of an anonymous struct
@ 2022-08-03 16:44 gprocida at google dot com
  2022-09-19 14:58 ` [Bug default/29443] " dodji at redhat dot com
  2022-09-20  7:56 ` dodji at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: gprocida at google dot com @ 2022-08-03 16:44 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 29443
           Summary: abidw loses declarations of global variables having
                    the same name and type as a member of an anonymous
                    struct
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Hi Dodji.

Here is a test case we reproduced at current master:
df28c220976f41620b0bd7b22000815e11f66b75

Consider this small example:

== missing_xx.cc ==
struct A {
  struct {
    int xx;
  };
};

struct A a;
int xx;

Compiled with either g++ 11.3.0 or clang++ 13.0.1
abidw --no-show-locs --no-comp-dir-path --type-id-style hash
produces XML that has the elf-symbol xx, but no var-decl:

<abi-corpus version='2.1' path='missing_xx.o' architecture='elf-amd-x86_64'>
  <elf-variable-symbols>
    <elf-symbol name='a' size='4' type='object-type' binding='global-binding'
visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='xx' size='4' type='object-type' binding='global-binding'
visibility='default-visibility' is-defined='yes'/>
  </elf-variable-symbols>
  <abi-instr address-size='64' path='missing_xx.cc'
language='LANG_C_plus_plus_14'>
    <type-decl name='int' size-in-bits='32' id='95e97e5e'/>
    <class-decl name='A' size-in-bits='32' is-struct='yes' visibility='default'
id='3ed987a4'>
      <member-type access='public'>
        <class-decl name='__anonymous_struct__' size-in-bits='32'
is-struct='yes' is-anonymous='yes' visibility='default' id='e7f43f72'>
          <data-member access='public' layout-offset-in-bits='0'>
            <var-decl name='xx' type-id='95e97e5e' visibility='default'/>
          </data-member>
        </class-decl>
      </member-type>
      <data-member access='public' layout-offset-in-bits='0'>
        <var-decl name='' type-id='e7f43f72' visibility='default'/>
      </data-member>
    </class-decl>
    <var-decl name='a' type-id='3ed987a4' mangled-name='a' visibility='default'
elf-symbol-id='a'/>
  </abi-instr>
</abi-corpus>

The problem goes away if the anonymous struct is removed or the type differs:

struct A {
  int xx;
};

or

struct A {
  struct {
    char xx;
  };
};

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

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

* [Bug default/29443] abidw loses declarations of global variables having the same name and type as a member of an anonymous struct
  2022-08-03 16:44 [Bug default/29443] New: abidw loses declarations of global variables having the same name and type as a member of an anonymous struct gprocida at google dot com
@ 2022-09-19 14:58 ` dodji at redhat dot com
  2022-09-20  7:56 ` dodji at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dodji at redhat dot com @ 2022-09-19 14:58 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2022-09-19
     Ever confirmed|0                           |1

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

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

* [Bug default/29443] abidw loses declarations of global variables having the same name and type as a member of an anonymous struct
  2022-08-03 16:44 [Bug default/29443] New: abidw loses declarations of global variables having the same name and type as a member of an anonymous struct gprocida at google dot com
  2022-09-19 14:58 ` [Bug default/29443] " dodji at redhat dot com
@ 2022-09-20  7:56 ` dodji at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dodji at redhat dot com @ 2022-09-20  7:56 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from dodji at redhat dot com ---
This should be fixed by the patch
https://sourceware.org/git/?p=libabigail.git;a=commit;h=6de60eb70ef2fdfee87f386410ffc8e67c436018.

Thanks for filling this and sorry for the inconvenience.

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

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

end of thread, other threads:[~2022-09-20  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 16:44 [Bug default/29443] New: abidw loses declarations of global variables having the same name and type as a member of an anonymous struct gprocida at google dot com
2022-09-19 14:58 ` [Bug default/29443] " dodji at redhat dot com
2022-09-20  7:56 ` 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).