From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 342373858D39 for ; Tue, 19 Sep 2023 12:41:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 342373858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695127288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hx1cT2qVT8GrwSzhF1LmFRR2Jyh1JtdmfMilKMCrbsM=; b=PJanUz2vBzJde5RdYaSzItkS9Ez53PPvU4jNT4s0GmmX/glCaMzLU6BH3WwZEkaSWI5oG0 YFHNS+uAW5cLXm4QZ4c/vA2XtN2PqIGMB/b2Po/hob6LTzOJ9iQFaGo2Ey2EwfjQYQ8xl+ HgcGwT3FBEA0iKE16C9p2FMQQ47zAYA= Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-ku2gkKSAP0eYftXdSuAwlg-1; Tue, 19 Sep 2023 08:41:27 -0400 X-MC-Unique: ku2gkKSAP0eYftXdSuAwlg-1 Received: by mail-yb1-f198.google.com with SMTP id 3f1490d57ef6-d814105dc2cso6233838276.2 for ; Tue, 19 Sep 2023 05:41:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695127287; x=1695732087; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Q4B48RHD2D1+CrSazkd6UuKrnQiCFDM6e4Igm4YQkPI=; b=B5Ck2lIWJQIwo48301aZ17r2XHxZ4eB/xYxwjuLL78Nz++wuv9esNbK5Nrc2IY72RP wgeD+Hfl7q5qNYMQQLlKGP5rNDHlTr0D19UtYGYcbF+0CxRQyzd6ek7+S8x/QYb9ZRbH InGI5o2D2b9N+kltoKu05NGIzvBS3PfKBvurDzb9ZroeNAybRRKybUZcOgQIZTscKFY7 chEgQfT4VbpKRgZ+21vfblYLMlT6P9UofVROi3Rh8s0+jxcCHRvTTV+pJiMXfTtHcQ4B evcaujq2y+H4/Wi8JChuz7zwi+W6u3Z2/bA9WZMnuDuZFzfNq2Z3XQQUxRLkZLhOcxD5 X46w== X-Gm-Message-State: AOJu0YxOG1CB5c0SEjZOc4wYQSf478je2m45P7IoeLBy/ZmMjFWxDhfG MHS9Er4sWU03g2ChAHqn12B08gBDNWh94EX1LGxSujaxqDbyuZ3M2P57EbspxH18Na2obYLcwN0 HAJ5B1u5G9x4unX2AWiLqyx1HJFM5 X-Received: by 2002:a5b:70b:0:b0:d7a:c0b8:f171 with SMTP id g11-20020a5b070b000000b00d7ac0b8f171mr11682021ybq.37.1695127286523; Tue, 19 Sep 2023 05:41:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgBmSTEqINOVeImQs/fuA3hL9LS7+GZlZ79FIEMYs0BFYq0jzPkaWpJKZzHaB5QW9sDPehCQ== X-Received: by 2002:a5b:70b:0:b0:d7a:c0b8:f171 with SMTP id g11-20020a5b070b000000b00d7ac0b8f171mr11681996ybq.37.1695127286067; Tue, 19 Sep 2023 05:41:26 -0700 (PDT) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id y190-20020a25dcc7000000b00d1b86efc0ffsm2855471ybe.6.2023.09.19.05.41.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 05:41:25 -0700 (PDT) Message-ID: <4c6eca31-175a-9e60-613f-1f827ddc9334@redhat.com> Date: Tue, 19 Sep 2023 08:41:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/3] elf: Record main program constructor/destructor in ordering tests To: Florian Weimer , libc-alpha@sourceware.org References: <7956993aec569453b3d537dffbfd7962f159a3b6.1695113064.git.fweimer@redhat.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <7956993aec569453b3d537dffbfd7962f159a3b6.1695113064.git.fweimer@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SCC_10_SHORT_WORD_LINES,SCC_20_SHORT_WORD_LINES,SCC_35_SHORT_WORD_LINES,SCC_5_SHORT_WORD_LINES,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 9/19/23 04:48, Florian Weimer wrote: > Previously, the ordering was not capture in the test output. Adjust s/capture/captured/g (as noted by Andreas) > expected test output accordingly. Note that after commit 6985865bc3a > ("elf: Always call destructors in reverse constructor order > (bug 30785)"), the main program destructors in tst-bz28937 run last > (which is bug XXX). Do we need to fill in bug XXX? > --- > elf/dso-sort-tests-1.def | 24 ++++++++++++------------ > elf/dso-sort-tests-2.def | 4 ++-- > scripts/dso-ordering-test.py | 32 +++++++++++++++++++++----------- > 3 files changed, 35 insertions(+), 25 deletions(-) >=20 > diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def > index 61dc54f8ae..cefc474e4f 100644 > --- a/elf/dso-sort-tests-1.def > +++ b/elf/dso-sort-tests-1.def > @@ -8,59 +8,59 @@ tunable_option: glibc.rtld.dynamic_sort=3D2 > =20 > # Sequence of single dependencies with no cycles. > tst-dso-ordering1: a->b->c > -output: c>b>a>{} +output: c>b>a>.>{}<. =20 > # Sequence including 2 dependent DSOs not at the end of the graph. > tst-dso-ordering2: a->b->[cd]->e > -output: e>d>c>b>a>{} +output: e>d>c>b>a>.>{}<. =20 > # Complex order with 3 "layers" of full dependencies > tst-dso-ordering3: a->[bc]->[def]->[gh]->i > -output: i>h>g>f>e>d>c>b>a>{} +output: i>h>g>f>e>d>c>b>a>.>{}<. =20 > # Sequence including 2 dependent DSOs at the end of the graph. > # Additionally the same dependencies appear in two paths. > tst-dso-ordering4: a->b->[de];a->c->d->e > -output: e>d>c>b>a>{} +output: e>d>c>b>a>.>{}<. =20 > # Test that b->c cross link is respected correctly > tst-dso-ordering5: a!->[bc]->d;b->c > -output: d>c>b>a>{} +output: d>c>b>a>.>{}<. =20 > # First DSO fully dependent on 4 DSOs, with another DSO at the end of ch= ain. > tst-dso-ordering6: a->[bcde]->f > -output: f>e>d>c>b>a>{} +output: f>e>d>c>b>a>.>{}<. =20 > # Sequence including 2 dependent and 3 dependent DSOs, and one of the > # dependent DSOs is dependent on an earlier DSO. > tst-dso-ordering7: a->[bc];b->[cde];e->f > -output: f>e>d>c>b>a>{} +output: f>e>d>c>b>a>.>{}<. =20 > # Sequence where the DSO c is unerlinked and calls a function in DSO a w= hich > # is technically a cycle. The main executable depends on the first two = DSOs. > # Note: This test has unspecified behavior. > tst-dso-ordering8: a->b->c=3D>a;{}->[ba] > -output: c>b>a>{} +output: c>b>a>.>{}<. =20 > # Generate the permutation of DT_NEEDED order between the main binary an= d > # all 5 DSOs; all link orders should produce exact same init/fini orderi= ng > tst-dso-ordering9: a->b->c->d->e;{}!->[abcde] > -output: e>d>c>b>a>{} +output: e>d>c>b>a>.>{}<. =20 > # Test if init/fini ordering behavior is proper, despite main program wi= th > # an soname that may cause confusion > tst-dso-ordering10: {}->a->b->c;soname({})=3Dc > -output: b>a>{} +output: b>a>.>{}<. =20 > # Complex example from Bugzilla #15311, under-linked and with circular > # relocation(dynamic) dependencies. For both sorting algorithms, the > # destruction order is the reverse of the construction order, and > # relocation dependencies are not taken into account. > tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=3D>[ba];c= =3D>a;b=3D>e=3D>a;c=3D>f=3D>b;d=3D>g=3D>c > -output: {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(= b(e(a()))))));-d[];-g[];-f[];-e[];-a[ +output: .>{+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()= f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[ =20 > # Test that even in the presence of dependency loops involving dlopen'ed > # object, that object is initialized last (and not unloaded prematurely)= . > # Final destructor order is the opposite of constructor order. > tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=3D>a1 > -output: {+a[a2>a1>a>];+b[b1>b>];-b[];%c(a1());} +output: .>{+a[a2>a1>a>];+b[b1>b>];-b[];%c(a1());} diff --git a/elf/dso-sort-tests-2.def b/elf/dso-sort-tests-2.def > index b79e79ecb7..73792de53b 100644 > --- a/elf/dso-sort-tests-2.def > +++ b/elf/dso-sort-tests-2.def > @@ -610,5 +610,5 @@ M30X22 > M30X23 > M30X24 > M30X25 > -xfail_output(glibc.rtld.dynamic_sort=3D1): M30X19>M30X15>M30X16>M30X11>M= 30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12= >M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X= 18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M2= 8X17>M28X11>M28X22>M27X14>M28X18>M27X15>M28X13>M27X11>M28X23>M27X25>M28X14>= M28X25>M27X23>M27X22>M28X24>M27X21>M27X13>M27X19>M27X17>M26X11>M26X23>M26X2= 1>M26X22>M26X20>M26X16>M25X21>M17X22>M15X15>M20X14>M20X16>M18X18>M28X12>M27= X24>M25X17>M27X20>M26X18>M26X17>M27X16>M26X19>M25X18>M26X24>M25X20>M24X17>M= 23X18>M25X13>M26X13>M17X23>M16X16>M26X12>M25X12>M26X15>M24X19>M25X23>M25X24= >M25X25>M24X20>M25X19>M24X21>M23X17>M22X21>M24X14>M23X22>M24X24>M22X20>M24X= 13>M25X11>M24X12>M25X15>M23X15>M25X16>M24X22>M23X13>M24X18>M23X14>M22X22>M2= 1X20>M24X25>M23X16>M22X25>M21X19>M22X14>M23X11>M22X15>M21X18>M22X19>M21X17>= M20X17>M19X17>M21X24>M21X12>M20X22>M19X16>M18X25>M19X21>M19X20>M18X24>M20X1= 2>M19X11>M23X20>M22X24>M22X16>M21X21>M25X14>M23X19>M23X24>M20X24>M19X12>M18= X15>M17X14>M16X18>M14X25>M16X22>M16X20>M17X17>M22X12>M21X11>M20X15>M18X22>M= 19X24>M19X18>M18X21>M17X16>M17X18>M16X21>M15X20>M19X22>M18X20>M18X11>M17X19= >M16X17>M15X21>M16X14>M16X13>M15X22>M14X20>M17X25>M16X19>M14X21>M13X24>M12X= 12>M16X24>M15X23>M14X16>M16X15>M15X25>M15X11>M15X12>M14X15>M13X14>M14X22>M1= 3X20>M12X13>M11X11>M22X23>M21X15>M21X16>M20X21>M20X20>M18X17>M19X25>M18X23>= M21X13>M15X17>M15X18>M18X19>M17X24>M16X12>M17X13>M20X25>M19X23>M15X19>M14X1= 3>M13X18>M15X13>M17X12>M16X11>M18X13>M18X12>M14X11>M14X24>M13X19>M15X14>M17= X20>M20X11>M20X13>M21X14>M15X24>M14X12>M13X22>M14X23>M13X23>M14X19>M17X15>M= 16X25>M17X11>M18X14>M19X19>M21X25>M13X12>M13X11>M14X18>M13X13>M12X11>M15X16= >M14X14>M27X12>M17X21>M20X23>M22X13>M21X22>M24X16>M24X15>M26X25>M23X25>M26X= 14>M23X12>M22X18>M24X11>M16X23>M19X14>M19X13>M21X23>M22X17>M23X23>M23X21>M2= 5X22>M18X16>M19X15>M20X18>M20X19>M22X11>M24X23>C156>C118>C143>C137>C147>C10= 6>C168>C113>C163>C155>C105>C146>C187>A150>C139>C180>C164>C193>C157>A191>C15= 8>B188>A159>C184>C121>C154>B171>A105>C131>C104>B104>C161>C111>B145>C160>B15= 5>A163>C112>C142>B148>C133>B198>A198>A115>C114>B157>A156>C175>B144>A120>C17= 3>B184>A174>C126>B107>A139>C194>B194>A194>C116>B116>C166>B160>B110>A110>C12= 8>B128>A128>C179>B162>A154>C186>B187>A179>C124>B181>A101>C153>B158>A136>C13= 5>C176>A192>B133>A133>C177>B177>A177>C185>C103>B141>A141>C183>A162>C192>C12= 9>B179>C144>B124>B183>C127>B127>A127>B108>A112>B153>A153>C167>B167>A186>A12= 2>C162>A144>B149>C174>B131>A185>C141>B106>A126>A167>C140>B122>A170>C198>B14= 3>C117>C123>B123>A147>A106>C200>B169>C191>B175>A123>B118>A182>C132>B151>A14= 5>A104>A109>C159>C150>B119>A119>A178>B164>B114>A164>C181>A102>C122>B134>A15= 7>A116>C195>B191>B111>C172>B172>A118>B129>A129>C149>A107>C170>B197>A197>A17= 3>B168>A132>C107>B165>A160>A131>C188>A168>B109>C178>A189>A148>C119>C190>C12= 0>B166>B176>C108>B135>B139>A103>B178>A169>B132>C125>C138>B163>A111>B170>C11= 0>A165>C151>C169>C199>A138>C182>A135>B101>B142>C101>C148>B193>B152>A158>A19= 9>C136>B137>A161>B120>A108>A149>A125>B113>A184>C171>A134>A175>A124>B150>B16= 1>B102>A146>A187>C130>B192>B200>A200>A142>A183>C102>B105>B156>A176>C165>B14= 7>A137>A196>B190>A190>B125>C134>C189>B126>B186>A166>B136>B195>A195>B154>B13= 8>B112>B173>A117>B159>B182>A181>A140>C145>B117>A152>A193>C197>B130>A172>A11= 3>A151>B115>A143>B140>B185>B103>A121>A180>A130>A171>B199>C196>B146>B180>C11= 5>B174>B121>A188>B196>B189>C152>C109>A155>A114>M14X17>M13X15>M13X16>M13X17>= M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X2= 0>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11= X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{} -output(glibc.rtld.dynamic_sort=3D2): M30X19>M30X15>M30X16>M30X11>M30X12>= M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X2= 2>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28= X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M= 28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18= >M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X= 13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M2= 6X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>= M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X1= 7>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23= X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M= 23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17= >M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X= 13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M1= 8X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>= M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X1= 6>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16= X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M= 15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22= >M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X= 24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M1= 7X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>= M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X1= 2>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21= X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M= 25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146= >C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138= >C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174= >C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130= >C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168= >C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140= >C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188= >C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183= >C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191= >C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120= >C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156= >C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175= >C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137= >C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124= >C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148= >C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119= >C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145= >C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186= >C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101= >C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141= >C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17= >M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X= 22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M1= 1X17>M11X16>M11X15>M11X14>M11X13>M11X12>{} +xfail_output(glibc.rtld.dynamic_sort=3D1): M30X19>M30X15>M30X16>M30X11>M= 30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12= >M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X= 18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M2= 8X17>M28X11>M28X22>M27X14>M28X18>M27X15>M28X13>M27X11>M28X23>M27X25>M28X14>= M28X25>M27X23>M27X22>M28X24>M27X21>M27X13>M27X19>M27X17>M26X11>M26X23>M26X2= 1>M26X22>M26X20>M26X16>M25X21>M17X22>M15X15>M20X14>M20X16>M18X18>M28X12>M27= X24>M25X17>M27X20>M26X18>M26X17>M27X16>M26X19>M25X18>M26X24>M25X20>M24X17>M= 23X18>M25X13>M26X13>M17X23>M16X16>M26X12>M25X12>M26X15>M24X19>M25X23>M25X24= >M25X25>M24X20>M25X19>M24X21>M23X17>M22X21>M24X14>M23X22>M24X24>M22X20>M24X= 13>M25X11>M24X12>M25X15>M23X15>M25X16>M24X22>M23X13>M24X18>M23X14>M22X22>M2= 1X20>M24X25>M23X16>M22X25>M21X19>M22X14>M23X11>M22X15>M21X18>M22X19>M21X17>= M20X17>M19X17>M21X24>M21X12>M20X22>M19X16>M18X25>M19X21>M19X20>M18X24>M20X1= 2>M19X11>M23X20>M22X24>M22X16>M21X21>M25X14>M23X19>M23X24>M20X24>M19X12>M18= X15>M17X14>M16X18>M14X25>M16X22>M16X20>M17X17>M22X12>M21X11>M20X15>M18X22>M= 19X24>M19X18>M18X21>M17X16>M17X18>M16X21>M15X20>M19X22>M18X20>M18X11>M17X19= >M16X17>M15X21>M16X14>M16X13>M15X22>M14X20>M17X25>M16X19>M14X21>M13X24>M12X= 12>M16X24>M15X23>M14X16>M16X15>M15X25>M15X11>M15X12>M14X15>M13X14>M14X22>M1= 3X20>M12X13>M11X11>M22X23>M21X15>M21X16>M20X21>M20X20>M18X17>M19X25>M18X23>= M21X13>M15X17>M15X18>M18X19>M17X24>M16X12>M17X13>M20X25>M19X23>M15X19>M14X1= 3>M13X18>M15X13>M17X12>M16X11>M18X13>M18X12>M14X11>M14X24>M13X19>M15X14>M17= X20>M20X11>M20X13>M21X14>M15X24>M14X12>M13X22>M14X23>M13X23>M14X19>M17X15>M= 16X25>M17X11>M18X14>M19X19>M21X25>M13X12>M13X11>M14X18>M13X13>M12X11>M15X16= >M14X14>M27X12>M17X21>M20X23>M22X13>M21X22>M24X16>M24X15>M26X25>M23X25>M26X= 14>M23X12>M22X18>M24X11>M16X23>M19X14>M19X13>M21X23>M22X17>M23X23>M23X21>M2= 5X22>M18X16>M19X15>M20X18>M20X19>M22X11>M24X23>C156>C118>C143>C137>C147>C10= 6>C168>C113>C163>C155>C105>C146>C187>A150>C139>C180>C164>C193>C157>A191>C15= 8>B188>A159>C184>C121>C154>B171>A105>C131>C104>B104>C161>C111>B145>C160>B15= 5>A163>C112>C142>B148>C133>B198>A198>A115>C114>B157>A156>C175>B144>A120>C17= 3>B184>A174>C126>B107>A139>C194>B194>A194>C116>B116>C166>B160>B110>A110>C12= 8>B128>A128>C179>B162>A154>C186>B187>A179>C124>B181>A101>C153>B158>A136>C13= 5>C176>A192>B133>A133>C177>B177>A177>C185>C103>B141>A141>C183>A162>C192>C12= 9>B179>C144>B124>B183>C127>B127>A127>B108>A112>B153>A153>C167>B167>A186>A12= 2>C162>A144>B149>C174>B131>A185>C141>B106>A126>A167>C140>B122>A170>C198>B14= 3>C117>C123>B123>A147>A106>C200>B169>C191>B175>A123>B118>A182>C132>B151>A14= 5>A104>A109>C159>C150>B119>A119>A178>B164>B114>A164>C181>A102>C122>B134>A15= 7>A116>C195>B191>B111>C172>B172>A118>B129>A129>C149>A107>C170>B197>A197>A17= 3>B168>A132>C107>B165>A160>A131>C188>A168>B109>C178>A189>A148>C119>C190>C12= 0>B166>B176>C108>B135>B139>A103>B178>A169>B132>C125>C138>B163>A111>B170>C11= 0>A165>C151>C169>C199>A138>C182>A135>B101>B142>C101>C148>B193>B152>A158>A19= 9>C136>B137>A161>B120>A108>A149>A125>B113>A184>C171>A134>A175>A124>B150>B16= 1>B102>A146>A187>C130>B192>B200>A200>A142>A183>C102>B105>B156>A176>C165>B14= 7>A137>A196>B190>A190>B125>C134>C189>B126>B186>A166>B136>B195>A195>B154>B13= 8>B112>B173>A117>B159>B182>A181>A140>C145>B117>A152>A193>C197>B130>A172>A11= 3>A151>B115>A143>B140>B185>B103>A121>A180>A130>A171>B199>C196>B146>B180>C11= 5>B174>B121>A188>B196>B189>C152>C109>A155>A114>M14X17>M13X15>M13X16>M13X17>= M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X2= 0>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11= X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>.>{}<. +output(glibc.rtld.dynamic_sort=3D2): M30X19>M30X15>M30X16>M30X11>M30X12>= M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X2= 2>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28= X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M= 28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18= >M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X= 13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M2= 6X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>= M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X1= 7>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23= X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M= 23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17= >M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X= 13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M1= 8X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>= M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X1= 6>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16= X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M= 15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22= >M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X= 24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M1= 7X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>= M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X1= 2>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21= X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M= 25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146= >C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138= >C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174= >C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130= >C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168= >C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140= >C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188= >C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183= >C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191= >C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120= >C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156= >C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175= >C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137= >C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124= >C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148= >C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119= >C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145= >C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186= >C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101= >C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141= >C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17= >M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X= 22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M1= 1X17>M11X16>M11X15>M11X14>M11X13>M11X12>.>{}<. diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py > index e4da3d64fd..f11ef68f21 100644 > --- a/scripts/dso-ordering-test.py > +++ b/scripts/dso-ordering-test.py > @@ -181,7 +181,7 @@ parts: > 3. Destructors' output > =20 > To see by example, a simple test description "a->b->c" generates a testc= ase > -that when run, outputs: "c>b>a>{} +that when run, outputs: "c>b>a>.>{}<. =20 > Each generated DSO constructor prints its name followed by a '>' charact= er, > and the "c>b>a" part above is the full constructor output by all DSOs, t= he > @@ -192,6 +192,9 @@ Destructor output for each DSO is a '<' character fol= lowed by its name, > reflecting its reverse nature of constructors. In the above example, th= e > destructor output part is " =20 > +The main program prints '.>' and '<.' when its constructors and > +destructors are invoked. OK. > + > The middle "{}" part is the main program. In this simple example, nothi= ng > was specified for the main program, so by default it is implicitly linke= d > to the DSO 'a' (with no other DSOs depending on it) and only prints the > @@ -201,7 +204,7 @@ To see an example with actions inside the main progra= m, lets see an example > description: c->g=3D>h;{+c;%c;-c}->a->h > =20 > This produces a testcase, that when executed outputs: > - h>a>{+c[g>c>];%c();-c[ + h>a>.>{+c[g>c>];%c();-c[ =20 > The constructor and destructor parts display the a->h dependency as expe= cted. > Inside the main program, the "+c" action triggers a dlopen() of DSO 'c', > @@ -218,6 +221,7 @@ by the main test program constructs documented earlie= r. > =20 > The output strings described here is the exact same form placed in > test description files' "output: " line. > + > """ > =20 > import sys > @@ -774,15 +778,9 @@ def process_testcase(t): > test_srcdir, base_test_name, exp_tunable_sfx, > ("X" if xfail else ""), test_name, tunable_descr= )) > =20 > - # Generate C files according to dependency and calling relations= from > - # description string. > - for obj in test_descr.objs: > - src_name =3D test_name + "-" + obj + ".c" > - f =3D open(testpfx_src + src_name, "w") > - if obj in test_descr.callrefs: > - called_objs =3D test_descr.callrefs[obj] > - for callee in called_objs: > - f.write("extern void fn_%s (void);\n" % (callee)) > + def write_initfini(f, obj): > + """Write init/fini ELF constructor/destructor functions to F= .""" > + OK. Create a subroutine. Later we will call it by moving the loop up a leve= l. > if len(obj) =3D=3D 1: > f.write("extern int putchar(int);\n") > f.write("static void __attribute__((constructor)) " + > @@ -795,6 +793,17 @@ def process_testcase(t): > 'init(void){printf("%s>");}\n' % (obj)) > f.write('static void __attribute__((destructor)) ' + > 'fini(void){printf("<%s");}\n' % (obj)) > + > + # Generate C files according to dependency and calling relations= from > + # description string. > + for obj in test_descr.objs: > + src_name =3D test_name + "-" + obj + ".c" > + f =3D open(testpfx_src + src_name, "w") > + if obj in test_descr.callrefs: > + called_objs =3D test_descr.callrefs[obj] > + for callee in called_objs: > + f.write("extern void fn_%s (void);\n" % (callee)) > + write_initfini(f, obj) OK. Call write_initfini. > if obj in test_descr.callrefs: > called_objs =3D test_descr.callrefs[obj] > if len(obj) !=3D 1: > @@ -828,6 +837,7 @@ def process_testcase(t): > f.write("#include \n") > f.write("#include \n") > f.write("#include \n") > + write_initfini(f, '.') Lastly, for the main program. > for s in test_descr.main_program: > if s[0] =3D=3D '@': > f.write("extern void fn_%s (void);\n" % (s[1:])); --=20 Cheers, Carlos.