Summary: | [libabigail] Handle data member replacement by anonymous data members | ||
---|---|---|---|
Product: | libabigail | Reporter: | David Marchand <david.marchand> |
Component: | default | Assignee: | Dodji Seketeli <dodji> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | libabigail |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
David Marchand
2020-03-12 12:15:02 UTC
Thank you for filing this issue. I have been working on it and the work-in-progress code is in the branch at dodji/PR25661 at https://sourceware.org/git/?p=libabigail.git;a=shortlog;h=refs/heads/dodji/PR25661. You can check it out by doing: git clone -b dodji/PR25661 git://sourceware.org/git/libabigail.git libabigail/PR25661 Here is what the code of the dodji/PR25661 branch does so far, on the example submitted in this problem report: $ diff -u test5-v0.c test5-v1.c --- test5-v0.c 2020-04-29 15:27:48.928684182 +0200 +++ test5-v1.c 2020-04-29 15:26:47.431127898 +0200 @@ -2,9 +2,15 @@ struct S { - uint64_t marker[0]; - uint64_t a; - uint64_t b; + union + { + uint64_t marker[0]; + struct + { + uint64_t a; + uint64_t b; + }; + }; uint64_t c; }; $ build/tools/abidiff test5-v0.o test5-v1.o Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable $ abidiff --harmless test5-v0.o test5-v1.o Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub-type change: [C] 'function void func(S*)' at test5-v1.c:18:1 has some indirect sub-type changes: parameter 1 of type 'S*' has sub-type changes: in pointed to type 'struct S' at test5-v1.c:3:1: type size hasn't changed data members 'S::a', 'S::marker', 'S::b' were replaced by anonymous data member: 'union {uint64_t marker[]; struct {uint64_t a; uint64_t b;};}' $ I am doing more testing and reviewing of the code base, but if you have time, you might want to test it as well. I'll hopefully be able to submit the change soon once I am done with the testing and cleanup. Works for me. Thanks! This should now be solved in the master branch by patches from https://sourceware.org/git/?p=libabigail.git;a=commit;h=48f26ddc00164bd0add63f933ade44e6327121a6 to https://sourceware.org/git/?p=libabigail.git;a=commit;h=5eb4d7627acb52daab6122fd8735362bbeaf19d3. It should be available in the coming 1.8 version of Libabigail. Thanks! |