From patchwork Mon Feb 8 11:35:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 41963 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 629DE386F467; Mon, 8 Feb 2021 11:35:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 629DE386F467 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612784132; bh=HEyJR+A5ynIw6ir2N2vm6SKwccCwLFP4zI0YMui1xLI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=hrcu9ATcI0NseAvSW0J2IdQdgss+QleIZkJOVEfbzQ9MrenOLe3/Hup7FQnB+BrZG Oe6XipZ+dDKNZpUbzp1sLZMw4EwbAnJL8ak0CeXf3BVrYKwvDX964Jl5zHeC1kAHr0 4OUiGwVc99zLZsMHbDsILj9mcbRGRX5/+ihVS6QU= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 44622386F467 for ; Mon, 8 Feb 2021 11:35:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 44622386F467 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-389-Z_gT4piEMb2qWyYWlOZm-A-1; Mon, 08 Feb 2021 06:35:24 -0500 X-MC-Unique: Z_gT4piEMb2qWyYWlOZm-A-1 Received: by mail-wr1-f69.google.com with SMTP id f5so2669105wro.7 for ; Mon, 08 Feb 2021 03:35:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=HEyJR+A5ynIw6ir2N2vm6SKwccCwLFP4zI0YMui1xLI=; b=cbOdslO6jkKQGk0ST4P+dFEnKAvi8c9K/6kdv/XI67EP2kdrMaYl7Gy/4DPfI/zXm8 t2t38E3tR9wYHfkDtu7E6Dg4IaTHt3yXEZqgsucwCRsfC+CKA2J29S/uC/gJBX+n7w6C f0FkB8naPdHCN0Rd8lJW9JFxTS90mNRDKuaHk/CRpsKwwuO0LvcnLv3BYy7pxpD6Xg0G Tlp1NvotjohQzTLVh3z05q+c70++lKCfewkQuFBpX8rT28gYYsFoKqftdebQdDLe+uxg EbASXxiXIoqLU0se1EsJL+8jPJkFiaKaKqi/waSfOWv9sDgXwXFcbKnGFZmXPiKmFk8z r5Hg== X-Gm-Message-State: AOAM531N7gXdGow+Eb/ovX20ziN6dvXK51YuREZeC+YPpNuSaelzwpDX s2Q4+uAWSNEkU75WbUBLsS0sTSB8aTy9wFYWlmkeHoP3R1L/iPJz3iM0ONI3/IbwOFRC4BOviXd tyKR2R9/gbgvWK/cuGoTCCjAfXLb6ESVkQudpQHvWt3ytkPdV+zygbxogyno76czCIHOj X-Received: by 2002:a05:6000:cd:: with SMTP id q13mr19386057wrx.138.1612784122713; Mon, 08 Feb 2021 03:35:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPd9FKkylcaRb7ZUT/0+997xmwhlO9wFTDL+IbwByycGRkpaJ2Q3K6uusEnR+FQGAKqB9TlQ== X-Received: by 2002:a05:6000:cd:: with SMTP id q13mr19386026wrx.138.1612784122353; Mon, 08 Feb 2021 03:35:22 -0800 (PST) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id t6sm8106380wmj.22.2021.02.08.03.35.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 03:35:21 -0800 (PST) Received: by localhost (Postfix, from userid 1001) id 094441A0F4C; Mon, 8 Feb 2021 12:35:21 +0100 (CET) To: libabigail@sourceware.org Subject: [PATCH] Bug 27267 - Better support for opaque enum types Organization: Red Hat / France X-Operating-System: Red Hat Enterprise Linux Server 7.8 X-URL: http://www.redhat.com Date: Mon, 08 Feb 2021 12:35:21 +0100 Message-ID: <86pn1ahjwm.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hello, Upon a request to build the IR for a opaque enum type, get_opaque_version_of_type wrongly returns a nil type even though the code is in there to construct an opaque variant of the enum. This patch cleans up that code to let it build an opaque enum type. It also ensures the opaque enum type is properly added to its lexical scope to ensure proper life cycle management. * src/abg-dwarf-reader.cc (get_opaque_version_of_type): Do not quit early for enum types, because the code that comes a bit later can handle enums. Add the newly built enum to its scope for proper life cycle management. * tests/data/test-diff-suppr/PR27267/include-dir-v{0,1}/include.h: New include files for the input test library. * tests/data/test-diff-suppr/PR27267/libtestpr27267-v{0,1}.so: New input test library. * tests/data/test-diff-suppr/PR27267/report-1.txt: New reference output for the comparison. * tests/data/test-diff-suppr/PR27267/v{0,1}.c: Source code for the new input test library. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the new test input above to the test harness. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-dwarf-reader.cc | 7 +----- tests/data/Makefile.am | 7 ++++++ .../PR27267/include-dir-v0/include.h | 8 ++++++ .../PR27267/include-dir-v1/include.h | 8 ++++++ .../test-diff-suppr/PR27267/libtestpr27267-v0.so | Bin 0 -> 17376 bytes .../test-diff-suppr/PR27267/libtestpr27267-v1.so | Bin 0 -> 17400 bytes tests/data/test-diff-suppr/PR27267/report-1.txt | 0 tests/data/test-diff-suppr/PR27267/v0.c | 25 ++++++++++++++++++ tests/data/test-diff-suppr/PR27267/v1.c | 28 +++++++++++++++++++++ tests/test-diff-suppr.cc | 10 ++++++++ 10 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 tests/data/test-diff-suppr/PR27267/include-dir-v0/include.h create mode 100644 tests/data/test-diff-suppr/PR27267/include-dir-v1/include.h create mode 100755 tests/data/test-diff-suppr/PR27267/libtestpr27267-v0.so create mode 100755 tests/data/test-diff-suppr/PR27267/libtestpr27267-v1.so create mode 100644 tests/data/test-diff-suppr/PR27267/report-1.txt create mode 100644 tests/data/test-diff-suppr/PR27267/v0.c create mode 100644 tests/data/test-diff-suppr/PR27267/v1.c diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 13f1fe6..13c8182 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -15906,12 +15906,6 @@ get_opaque_version_of_type(read_context &ctxt, && tag != DW_TAG_enumeration_type) return result; - if (tag == DW_TAG_union_type) - // TODO: also handle declaration-only unions. To do that, we mostly - // need to adapt add_or_update_union_type to make it schedule - // declaration-only unions for resolution too. - return result; - string type_name, linkage_name; location type_location; die_loc_and_name(ctxt, type_die, type_location, type_name, linkage_name); @@ -15973,6 +15967,7 @@ get_opaque_version_of_type(read_context &ctxt, underlying_type, enumeratorz, linkage_name)); + add_decl_to_scope(enum_type, scope); result = enum_type; } } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 68ad902..a427659 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -1482,6 +1482,13 @@ test-diff-suppr/libtest48-soname-abixml-suppr.txt \ test-diff-suppr/libtest48-soname-abixml-suppr-2.txt \ test-diff-suppr/libtest48-soname-abixml-suppr-3.txt \ test-diff-suppr/libtest48-soname-abixml-suppr-4.txt \ +test-diff-suppr/PR27267/include-dir-v0/include.h \ +test-diff-suppr/PR27267/include-dir-v1/include.h \ +test-diff-suppr/PR27267/v0.c \ +test-diff-suppr/PR27267/v1.c \ +test-diff-suppr/PR27267/libtestpr27267-v0.so \ +test-diff-suppr/PR27267/libtestpr27267-v1.so \ +test-diff-suppr/PR27267/report-1.txt \ \ test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1 \ test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi \ diff --git a/tests/data/test-diff-suppr/PR27267/include-dir-v0/include.h b/tests/data/test-diff-suppr/PR27267/include-dir-v0/include.h new file mode 100644 index 0000000..0b91553 --- /dev/null +++ b/tests/data/test-diff-suppr/PR27267/include-dir-v0/include.h @@ -0,0 +1,8 @@ +enum opaque_enum; +struct opaque_struct; + +typedef enum opaque_enum opaque_enum; +typedef struct opaque_struct opaque_struct; + +void +fn(opaque_struct *, opaque_enum *e); diff --git a/tests/data/test-diff-suppr/PR27267/include-dir-v1/include.h b/tests/data/test-diff-suppr/PR27267/include-dir-v1/include.h new file mode 100644 index 0000000..0b91553 --- /dev/null +++ b/tests/data/test-diff-suppr/PR27267/include-dir-v1/include.h @@ -0,0 +1,8 @@ +enum opaque_enum; +struct opaque_struct; + +typedef enum opaque_enum opaque_enum; +typedef struct opaque_struct opaque_struct; + +void +fn(opaque_struct *, opaque_enum *e); diff --git a/tests/data/test-diff-suppr/PR27267/libtestpr27267-v0.so b/tests/data/test-diff-suppr/PR27267/libtestpr27267-v0.so new file mode 100755 index 0000000000000000000000000000000000000000..58df0022f6686c2f3ab34b284a30a91796eec4ec GIT binary patch literal 17376 zcmeHOUu+b|8K1qqv(G+rw)t0sDJ+qrLepFSA%FoH&NjA>3J7%}DpJvU?{4pIqx<9D z?tzKg6qOW(AS&`uHEQxup+2N9sE<+e0s^IdOry3@RH?F(rb?u=byc-8t;F^FcII2( zuGc{OfK+M6+WqGH^ZRDz+u51f^UQarj!#Dwvq$ zb~v`t71gTTf>07=!Y`H)Lu@lUE$pZ5Oq3n-CKv z+}8ky^?ck!VV@P{treGL(LSPrb=tQP3X|cQIeCU{`rQw<-TU*cKfU_8>kp}!#cSJseEgZwGD{OJq`*0Th=F9Om} z2AWo^)T)|g>vdbxn0D;+2`z8bjiPDUM*Z}O$#Sh~oYu2tgX@AdT5dtt3T9O=n=cxy zP-SH^n^Uctx{u8qKQ=L`ji@8)UMdr!h3!QVH4(sOETH9IhxSw{=~nEJ2amxN)D zPyTZu@AJutUp&Gc;IpB!QSxbv9G@Yjr4~6pdrHeKa_W<)>q~Qsb|9^CE)DNt1i}b} z5eOp?Mj(tp7=bVXVFbbmJjn?By?gt=GM7J(XRgIQ9Aqr>{o8h=`CjJoz4%?H8qK{Q zfw=kfAK~7;BMmv^OQ`#7vDs{9u8%pm>#_F{eqh<&1g@@N9$a-a7rS>{LgTxFg8k1> zd42CqB)cDEt}bQn{N+gI&a#}5-p%~_fxQtNoDmM<&Ba3Zj-xAhtnZ~U1JtbX%$dyP zu@TH>u6|;7f$QlMe7T&3YJHlA+q)y7ih+SJmu z9=I=G?YVL8t{W3K3fO`$g%JoN5Jn)3Kp25A0$~Kg2!s&`BM?R)j6fKH|KA8m{qiCF zUo!rWPg!aqBexe}RN*Y-R(LR^@_2!s&`BM?R)j6fKH zFalu&!U%*B2qO?i;E6_n_K*7ai_)G@+>45-ix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G`6!NrwK1KB>LsUYdIC2j99q4@~j%t3GTlnkcx9wd6{}X}# z6%{0?AOFQQ@TCzB_~|3?&#Zy(+QWf!kHGI2cz-*~0{{LRcxneydUsn*)6a5lSp*z^ sM8PtsKhU^}zYkL1;Rt>o#ouTk<)|Reu6kDZvr!QKje{I8@d*5X02toN82|tP literal 0 HcmV?d00001 diff --git a/tests/data/test-diff-suppr/PR27267/libtestpr27267-v1.so b/tests/data/test-diff-suppr/PR27267/libtestpr27267-v1.so new file mode 100755 index 0000000000000000000000000000000000000000..fdf648a5c2494ffd99f87e88bf7e8b385e6ca794 GIT binary patch literal 17400 zcmeHOU1%KF6~41S(n>3@B-?SnXbwtry%6>j7n?#)KsOBM61Ouu3?D7|-NZgC-09#BG4zZ)H zJQ)(QDmmd$M4T#ds>Bh$DcearCc^MGVmlAYcz!-8{fMJ4(wWbk0xzpvbgzr9^HHfL zPPlIZ4%_*lL}{Ou^=*`wRe62HrO2;uD^wPSW9IZZ*8J*1U*z^4?N>doy}9?xmq*_D z_m17z7QB4C&xn)l`vDX=q5jsz^HOThu$^if6UJ+&e`*8$H0U3P!%ycxv6;o$9hs0J za?tfsrB>B#$EZ8H&h!&!Pw54-Zk80OH7G4*U0)Ni}r~A~{VRd0PbKDC3nEJ1jSEOT~ zPyde8Cw+R7myd}6cyFj~)ZF&y@g5Sbc=UMhiB>&&>XT?oW`sv4Ft1){gL9C9AOk@L zf(!&12r>|4Ajm+Ffgl49GXsC`-TBY#{&R+g7_5p83bKjpp z-F)KDaPHleffCB|X#0G**=%O7k8#}f=qCt2wCX$pp{`&VLUlEldv{$z=MN+Y|DU7r z`o7nZ?YW!1x{`hWFUPX)uZFYAN7>)rb+$r)b231zxm@hsb$ktv?Y%T+f|)g*JeR#Z zmd0ZC>Ss<5gq}{pm& zK==s$FB$*Gr>-=c2Z7%KJ_j5L|Hq4@yfDj@#Xe=Ar!#f~{!usxI>asiwb@jGvqax? zBKeKp_{G>Ic5KIyukRh?|87Me_)$v5%m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4U5y$5b0vvi|gH zt=b~!V5^&D0|BzMP#LpK1Lz3_mcR+Yj8AnYFt<`J18Aip* zL)A412q%r#lCy25L4T;gZ5GYq*PgENK z%2w5+GGwYwTMOoP%t;M<4rbFx5uP5BEjqw0QN(sx=0bQqiPNm&u`D%iY)F}#!o0l)1CPxB4pI9?!8`^k?u z?mNYAMUrV=LR>{KkiY#x%UD6$2>-6Eh&aBdk*I#kA6-9QAI6?QC!jeLJe>RxkKf3C z{37TuC-gn;zJKL=*gxXR@PH6x1M}iliE}wQN=~nL;@|V(Gtxl(j~n1g{h|*~;~8-n znOex-{vSy^<)5k2U2^}-!jFH|hgT(zctM6EM)@cCbtoj@aPRL?VR83ylcVH>C;m3* zd*L8F%@g}H0U$pKcke&xe+dS~gQxjq@;-Qq_iHF%-=X?x-bwrHZ(?vD${W>7_y1$C zdF!Y7>GCj#F;y`4OnBn>UG2rQjC36lT$Lg*!V&)i7_jWNKO;O^>K6T7XYkB!9d7zWp2E zeTw%$3M0Kekm;=Z@5TN@Z+D{0RPxt;a|KD{(!{$uk*6R<8KyTqWZnuefB+$ z&ps`LRhe-7T?Ol){y^_l{N0fHjzEa>8T{=AC{Gm$aoxSbpOf0*e{om A1poj5 literal 0 HcmV?d00001 diff --git a/tests/data/test-diff-suppr/PR27267/report-1.txt b/tests/data/test-diff-suppr/PR27267/report-1.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/test-diff-suppr/PR27267/v0.c b/tests/data/test-diff-suppr/PR27267/v0.c new file mode 100644 index 0000000..74527dc --- /dev/null +++ b/tests/data/test-diff-suppr/PR27267/v0.c @@ -0,0 +1,25 @@ +/** + * + * Compile with: + * gcc -shared -g -Wall -o libtestpr27267-v0.so v0.c + * + */ + +#include "include-dir-v0/include.h" + +enum opaque_enum +{ + e0, + e1 +}; + +struct opaque_struct +{ + opaque_enum m0; +}; + +void +fn(opaque_struct * s, opaque_enum *e) +{ + s->m0 = *e; +} diff --git a/tests/data/test-diff-suppr/PR27267/v1.c b/tests/data/test-diff-suppr/PR27267/v1.c new file mode 100644 index 0000000..c36d09a --- /dev/null +++ b/tests/data/test-diff-suppr/PR27267/v1.c @@ -0,0 +1,28 @@ +/** + * + * Compile with: + * gcc -shared -g -Wall -o libtestpr27267-v1.so v1.c + * + */ + +#include "include-dir-v1/include.h" + +enum opaque_enum +{ + e0, + e1, + e2 +}; + +struct opaque_struct +{ + opaque_enum m0; + opaque_enum m1; +}; + +void +fn(opaque_struct * s, opaque_enum *e) +{ + s->m0 = *e; + s->m1 = s->m0; +} diff --git a/tests/test-diff-suppr.cc b/tests/test-diff-suppr.cc index c7b73fd..5b4d08d 100644 --- a/tests/test-diff-suppr.cc +++ b/tests/test-diff-suppr.cc @@ -2026,6 +2026,16 @@ InOutSpec in_out_specs[] = "data/test-diff-suppr/libtest48-soname-abixml-report-1.txt", "output/test-diff-suppr/libtest48-soname-abixml-report-1_suppr4.txt" }, + { + "data/test-diff-suppr/PR27267/libtestpr27267-v0.so", + "data/test-diff-suppr/PR27267/libtestpr27267-v1.so", + "data/test-diff-suppr/PR27267/include-dir-v0", + "data/test-diff-suppr/PR27267/include-dir-v1", + "", + "--drop-private-types --no-default-suppression", + "data/test-diff-suppr/PR27267/report-1.txt", + "output/test-diff-suppr/PR27267/report-1.txt" + }, // This should be the last entry {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} };