From patchwork Mon Dec 13 17:55:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 48881 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 33FBC3858438 for ; Mon, 13 Dec 2021 17:59:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33FBC3858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639418348; bh=mn0NSO0OY6FexSZTyzLVyZAKsFflDdYHWZXxR8Kvvwc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=et421cm0BZyBa81dOQ28+Gv/mCRV/+xhVrPnKPKowOiIq1F66R1RxdBIHqWnGj8qp MbJZKPuh2+47cdzkISABgRNK5oHk8Vi9FrnD6ny++lTy9sv4PVQxezXtr/JnIeVV/H CmCNAB1TattvoKIk0X1ZcPmIKzQpM9m2N6vZLG+0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 1FB503858423 for ; Mon, 13 Dec 2021 17:55:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FB503858423 Received: by mail-pg1-x52b.google.com with SMTP id 133so15202156pgc.12 for ; Mon, 13 Dec 2021 09:55:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mn0NSO0OY6FexSZTyzLVyZAKsFflDdYHWZXxR8Kvvwc=; b=ua2N8zVWpS+gYio+wD8DE5/uv6R25/hcwo2GAsaz9/yDyXNbKNdolOml6cd4WJG8Sa dbiewyn+I85Au4W8aVTI+5ZPpt4S3/83ACz2c92GlJcnGn7sfwlIBssfRrqGQh1Dveag VoWRAbmXJGXdHccNgbPMGcx+BphMQRxGESN5qEJywK7eTzYApBNa2yDkrWbLhvwb0F/B N0AxG9oqOUqLkRQEQDQf+gIQzpvpA30Ya3RDbt74RggAZZ/DS11Z9jnVEt7drdsamuUd XDfDbW01aWpQQmhdZXEllaNrRxPyGALyePtDzUrWZkiJR2qqsHOclzM1LqIjleDbgBJ5 0oPg== X-Gm-Message-State: AOAM533I3ckKNeyoN8+RZ4rnpp27zMsj7yYKq7tEH+FVOAz4aheO+sME lKB4fg2SJ7mhd/zNkpRHRyczRSrsk3Y= X-Google-Smtp-Source: ABdhPJyAPnTx6O+5zjSvtXWYsE9XM/GNGd61Ib8pA6CFraCSrUnY08WDfOgJyfJNV7/+RqLPAijWkg== X-Received: by 2002:a63:d117:: with SMTP id k23mr51908pgg.287.1639418111036; Mon, 13 Dec 2021 09:55:11 -0800 (PST) Received: from gnu-cfl-2.localdomain ([2607:fb90:a63f:468b:b937:402b:0:3d7]) by smtp.gmail.com with ESMTPSA id j13sm10881260pgg.5.2021.12.13.09.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 09:55:10 -0800 (PST) Received: from gnu-tgl-3.localdomain (gnu-tgl-3 [192.168.1.57]) by gnu-cfl-2.localdomain (Postfix) with ESMTPS id 4F6344215BE; Mon, 13 Dec 2021 09:55:09 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 2FCE2C0B7F; Mon, 13 Dec 2021 09:55:08 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v4 1/2] elf: Sort tests and modules-names Date: Mon, 13 Dec 2021 09:55:07 -0800 Message-Id: <20211213175508.243761-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213175508.243761-1-hjl.tools@gmail.com> References: <20211213175508.243761-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3030.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Sort tests and modules-names to reduce future conflicts. --- elf/Makefile | 518 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 388 insertions(+), 130 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index fe42caeb0e..10556c3a7e 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -199,40 +199,133 @@ static-dlopen-environment = \ tst-tls9-static-ENV = $(static-dlopen-environment) tst-single_threaded-static-dlopen-ENV = $(static-dlopen-environment) -tests += restest1 preloadtest loadfail multiload origtest resolvfail \ - constload1 order noload filter \ - reldep reldep2 reldep3 reldep4 nodelete nodelete2 \ - nodlopen nodlopen2 lateglobal initfirst global \ - restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ - tst-tls4 tst-tls5 \ - tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \ - tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \ - tst-align tst-align2 tst-align3 \ - tst-dlmodcount tst-dlopenrpath tst-deep1 \ - tst-dlmopen1 tst-dlmopen3 tst-dlmopen4 \ - unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \ - tst-audit1 tst-audit2 tst-audit8 tst-audit9 \ - tst-addr1 tst-thrlock \ - tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \ - tst-nodelete tst-dlopen-nodelete-reloc) \ - tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \ - tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \ - tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \ - tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \ - tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \ - tst-unwind-ctor tst-unwind-main tst-audit13 \ - tst-sonamemove-link tst-sonamemove-dlopen tst-dlopen-tlsmodid \ - tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \ - tst-dlopenfail-2 \ - tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \ - tst-single_threaded tst-single_threaded-pthread \ - tst-tls-ie tst-tls-ie-dlmopen argv0test \ - tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask \ - tst-tls20 tst-tls21 tst-dlmopen-dlerror tst-dlmopen-gethostbyname \ - tst-dl-is_dso tst-ro-dynamic \ - tst-audit18 \ - tst-rtld-run-static \ +tests += \ + argv0test \ + constload1 \ + dblload \ + dblunload \ + filter \ + global \ + initfirst \ + lateglobal \ + loadfail \ + multiload \ + next \ + nodelete \ + nodelete2 \ + nodlopen \ + nodlopen2 \ + noload \ + order \ + order2 \ + origtest \ + preloadtest \ + reldep \ + reldep2 \ + reldep3 \ + reldep4 \ + reldep5 \ + reldep6 \ + reldep7 \ + reldep8 \ + resolvfail \ + restest1 \ + restest2 \ + tst-absolute-sym \ + tst-absolute-zero \ + tst-addr1 \ + tst-align \ + tst-align2 \ + tst-align3 \ + tst-audit1 \ + tst-audit11 \ + tst-audit12 \ + tst-audit13 \ + tst-audit18 \ + tst-audit2 \ + tst-audit8 \ + tst-audit9 \ + tst-auditmany \ + tst-auxobj \ + tst-auxobj-dlopen \ + tst-big-note \ + tst-debug1 \ + tst-deep1 \ + tst-dl-is_dso \ + tst-dlmodcount \ + tst-dlmopen1 \ + tst-dlmopen3 \ + tst-dlmopen4 \ + tst-dlmopen-dlerror \ + tst-dlmopen-gethostbyname \ + tst-dlopenfail \ + tst-dlopenfail-2 \ + tst-dlopenrpath \ + tst-dlopen-self \ + tst-dlopen-tlsmodid \ + tst-dlsym-error \ + tst-filterobj \ + tst-filterobj-dlopen \ + tst-glibc-hwcaps \ + tst-glibc-hwcaps-mask \ + tst-glibc-hwcaps-prepend \ + tst-global1 \ + tst-initfinilazyfail \ + tst-initorder \ + tst-initorder2 \ + tst-latepthread \ + tst-main1 \ + tst-nodelete2 \ + tst-nodelete-dlclose \ + tst-nodelete-opened \ + tst-noload \ + tst-null-argv \ + tst-relsort1 \ + tst-ro-dynamic \ + tst-rtld-run-static \ + tst-single_threaded \ + tst-single_threaded-pthread \ + tst-sonamemove-dlopen \ + tst-sonamemove-link \ + tst-thrlock \ + tst-tls10 \ + tst-tls11 \ + tst-tls12 \ + tst-tls13 \ + tst-tls14 \ + tst-tls15 \ + tst-tls16 \ + tst-tls17 \ + tst-tls18 \ + tst-tls19 \ + tst-tls20 \ + tst-tls21 \ + tst-tls4 \ + tst-tls5 \ + tst-tlsalign \ + tst-tlsalign-extern \ + tst-tls-dlinfo \ + tst-tls-ie \ + tst-tls-ie-dlmopen \ + tst-tls-manydynamic \ + tst-unique1 \ + tst-unique2 \ + tst-unwind-ctor \ + tst-unwind-main \ + unload3 \ + unload4 \ + unload5 \ + unload6 \ + unload7 \ + unload8 \ # reldep9 +tests-cxx = \ + tst-dlopen-nodelete-reloc \ + tst-nodelete \ + tst-unique3 \ + tst-unique4 \ + +tests += $(if $(CXX),$(tests-cxx)) tests-internal += loadtest unload unload2 circleload1 \ neededtest neededtest2 neededtest3 neededtest4 \ tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \ @@ -280,103 +373,268 @@ tst-tls-many-dynamic-modules-dep-bad = \ extra-test-objs += $(tlsmod17a-modules:=.os) $(tlsmod18a-modules:=.os) \ tst-tlsalign-vars.o test-extras += tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars -modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ - testobj1_1 failobj constload2 constload3 unloadmod \ - dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \ - nodelmod1 nodelmod2 nodelmod3 nodelmod4 \ - nodel2mod1 nodel2mod2 nodel2mod3 \ - nodlopenmod nodlopenmod2 filtmod1 filtmod2 \ - reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ - reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ - neededobj1 neededobj2 neededobj3 neededobj4 \ - neededobj5 neededobj6 firstobj globalmod1 \ - unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ - dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ - reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ - reldep7mod1 reldep7mod2 \ - tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \ - tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \ - tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \ - tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \ - tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \ - $(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \ - tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \ - circlemod1 circlemod1a circlemod2 circlemod2a \ - circlemod3 circlemod3a \ - reldep8mod1 reldep8mod2 reldep8mod3 \ - reldep9mod1 reldep9mod2 reldep9mod3 \ - tst-alignmod tst-alignmod2 tst-alignmod3 \ - $(modules-execstack-$(have-z-execstack)) \ - tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \ - tst-dlmopen1mod tst-auditmod1 \ - unload3mod1 unload3mod2 unload3mod3 unload3mod4 \ - unload4mod1 unload4mod2 unload4mod3 unload4mod4 \ - unload6mod1 unload6mod2 unload6mod3 \ - unload7mod1 unload7mod2 \ - unload8mod1 unload8mod1x unload8mod2 unload8mod3 \ - order2mod1 order2mod2 order2mod3 order2mod4 \ - tst-unique1mod1 tst-unique1mod2 \ - tst-unique2mod1 tst-unique2mod2 \ - tst-auditmod9a tst-auditmod9b \ - $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \ - tst-nodelete-uniquemod tst-nodelete-rtldmod \ - tst-nodelete-zmod \ - tst-dlopen-nodelete-reloc-mod1 \ - tst-dlopen-nodelete-reloc-mod2 \ - tst-dlopen-nodelete-reloc-mod3 \ - tst-dlopen-nodelete-reloc-mod4 \ - tst-dlopen-nodelete-reloc-mod5 \ - tst-dlopen-nodelete-reloc-mod6 \ - tst-dlopen-nodelete-reloc-mod7 \ - tst-dlopen-nodelete-reloc-mod8 \ - tst-dlopen-nodelete-reloc-mod9 \ - tst-dlopen-nodelete-reloc-mod10 \ - tst-dlopen-nodelete-reloc-mod11 \ - tst-dlopen-nodelete-reloc-mod12 \ - tst-dlopen-nodelete-reloc-mod13 \ - tst-dlopen-nodelete-reloc-mod14 \ - tst-dlopen-nodelete-reloc-mod15 \ - tst-dlopen-nodelete-reloc-mod16 \ - tst-dlopen-nodelete-reloc-mod17) \ - tst-initordera1 tst-initorderb1 \ - tst-initordera2 tst-initorderb2 \ - tst-initordera3 tst-initordera4 \ - tst-initorder2a tst-initorder2b tst-initorder2c \ - tst-initorder2d \ - tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ - tst-array5dep tst-null-argv-lib \ - tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \ - tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \ - tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \ - tst-latepthreadmod $(tst-tls-many-dynamic-modules) \ - $(tst-tls-many-dynamic-modules-dep) \ - $(tst-tls-many-dynamic-modules-dep-bad) \ - tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \ - tst-main1mod tst-absolute-sym-lib \ - tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib \ - tst-audit13mod1 tst-sonamemove-linkmod1 \ - tst-sonamemove-runmod1 tst-sonamemove-runmod2 \ - tst-auditmanymod1 tst-auditmanymod2 tst-auditmanymod3 \ - tst-auditmanymod4 tst-auditmanymod5 tst-auditmanymod6 \ - tst-auditmanymod7 tst-auditmanymod8 tst-auditmanymod9 \ - tst-initlazyfailmod tst-finilazyfailmod \ - tst-dlopenfailmod1 tst-dlopenfaillinkmod tst-dlopenfailmod2 \ - tst-dlopenfailmod3 tst-dlopenfailnodelmod tst-ldconfig-ld-mod \ - tst-filterobj-flt tst-filterobj-aux tst-filterobj-filtee \ - tst-auditlogmod-1 tst-auditlogmod-2 tst-auditlogmod-3 \ - tst-single_threaded-mod1 tst-single_threaded-mod2 \ - tst-single_threaded-mod3 tst-single_threaded-mod4 \ - tst-tls-ie-mod0 tst-tls-ie-mod1 tst-tls-ie-mod2 \ - tst-tls-ie-mod3 tst-tls-ie-mod4 tst-tls-ie-mod5 \ - tst-tls-ie-mod6 libmarkermod1-1 libmarkermod1-2 libmarkermod1-3 \ - libmarkermod2-1 libmarkermod2-2 \ - libmarkermod3-1 libmarkermod3-2 libmarkermod3-3 \ - libmarkermod4-1 libmarkermod4-2 libmarkermod4-3 libmarkermod4-4 \ - tst-tls20mod-bad tst-tls21mod tst-dlmopen-dlerror-mod \ - tst-auxvalmod \ - tst-dlmopen-gethostbyname-mod tst-ro-dynamic-mod \ - tst-auditmod18 \ - tst-audit18mod \ +modules-names = \ + circlemod1 \ + circlemod1a \ + circlemod2 \ + circlemod2a \ + circlemod3 \ + circlemod3a \ + constload2 \ + constload3 \ + dblloadmod1 \ + dblloadmod2 \ + dblloadmod3 \ + dep1 \ + dep2 \ + dep3 \ + dep4 \ + failobj \ + filtmod1 \ + filtmod2 \ + firstobj \ + globalmod1 \ + libmarkermod1-1 \ + libmarkermod1-2 \ + libmarkermod1-3 \ + libmarkermod2-1 \ + libmarkermod2-2 \ + libmarkermod3-1 \ + libmarkermod3-2 \ + libmarkermod3-3 \ + libmarkermod4-1 \ + libmarkermod4-2 \ + libmarkermod4-3 \ + libmarkermod4-4 \ + ltglobmod1 \ + ltglobmod2 \ + neededobj1 \ + neededobj2 \ + neededobj3 \ + neededobj4 \ + neededobj5 \ + neededobj6 \ + nextmod1 \ + nextmod2 \ + nodel2mod1 \ + nodel2mod2 \ + nodel2mod3 \ + nodelmod1 \ + nodelmod2 \ + nodelmod3 \ + nodelmod4 \ + nodlopenmod \ + nodlopenmod2 \ + order2mod1 \ + order2mod2 \ + order2mod3 \ + order2mod4 \ + pathoptobj \ + reldep4mod1 \ + reldep4mod2 \ + reldep4mod3 \ + reldep4mod4 \ + reldep6mod0 \ + reldep6mod1 \ + reldep6mod2 \ + reldep6mod3 \ + reldep6mod4 \ + reldep7mod1 \ + reldep7mod2 \ + reldep8mod1 \ + reldep8mod2 \ + reldep8mod3 \ + reldep9mod1 \ + reldep9mod2 \ + reldep9mod3 \ + reldepmod1 \ + reldepmod2 \ + reldepmod3 \ + reldepmod4 \ + reldepmod5 \ + reldepmod6 \ + testobj1 \ + testobj1_1 \ + testobj2 \ + testobj3 \ + testobj4 \ + testobj5 \ + testobj6 \ + tst-absolute-sym-lib \ + tst-absolute-zero-lib \ + tst-alignmod \ + tst-alignmod2 \ + tst-alignmod3 \ + tst-array2dep \ + tst-array5dep \ + tst-audit11mod1 \ + tst-audit11mod2 \ + tst-audit12mod1 \ + tst-audit12mod2 \ + tst-audit12mod3 \ + tst-audit13mod1 \ + tst-audit18mod \ + tst-auditlogmod-1 \ + tst-auditlogmod-2 \ + tst-auditlogmod-3 \ + tst-auditmanymod1 \ + tst-auditmanymod2 \ + tst-auditmanymod3 \ + tst-auditmanymod4 \ + tst-auditmanymod5 \ + tst-auditmanymod6 \ + tst-auditmanymod7 \ + tst-auditmanymod8 \ + tst-auditmanymod9 \ + tst-auditmod1 \ + tst-auditmod11 \ + tst-auditmod12 \ + tst-auditmod18 \ + tst-auditmod9a \ + tst-auditmod9b \ + tst-auxvalmod \ + tst-big-note-lib \ + tst-deep1mod1 \ + tst-deep1mod2 \ + tst-deep1mod3 \ + tst-dlmopen1mod \ + tst-dlmopen-dlerror-mod \ + tst-dlmopen-gethostbyname-mod \ + tst-dlopenfaillinkmod \ + tst-dlopenfailmod1 \ + tst-dlopenfailmod2 \ + tst-dlopenfailmod3 \ + tst-dlopenfailnodelmod \ + tst-dlopenrpathmod \ + tst-filterobj-aux \ + tst-filterobj-filtee \ + tst-filterobj-flt \ + tst-finilazyfailmod \ + tst-initlazyfailmod \ + tst-initorder2a \ + tst-initorder2b \ + tst-initorder2c \ + tst-initorder2d \ + tst-initordera1 \ + tst-initordera2 \ + tst-initordera3 \ + tst-initordera4 \ + tst-initorderb1 \ + tst-initorderb2 \ + tst-latepthreadmod \ + tst-ldconfig-ld-mod \ + tst-main1mod \ + tst-nodelete2mod \ + tst-nodelete-dlclose-dso \ + tst-nodelete-dlclose-plugin \ + tst-nodelete-opened-lib \ + tst-null-argv-lib \ + tst-relsort1mod1 \ + tst-relsort1mod2 \ + tst-ro-dynamic-mod \ + tst-single_threaded-mod1 \ + tst-single_threaded-mod2 \ + tst-single_threaded-mod3 \ + tst-single_threaded-mod4 \ + tst-sonamemove-linkmod1 \ + tst-sonamemove-runmod1 \ + tst-sonamemove-runmod2 \ + tst-tls19mod1 \ + tst-tls19mod2 \ + tst-tls19mod3 \ + tst-tls20mod-bad \ + tst-tls21mod \ + tst-tlsalign-lib \ + tst-tls-ie-mod0 \ + tst-tls-ie-mod1 \ + tst-tls-ie-mod2 \ + tst-tls-ie-mod3 \ + tst-tls-ie-mod4 \ + tst-tls-ie-mod5 \ + tst-tls-ie-mod6 \ + tst-tlsmod1 \ + tst-tlsmod10 \ + tst-tlsmod11 \ + tst-tlsmod12 \ + tst-tlsmod13 \ + tst-tlsmod13a \ + tst-tlsmod14a \ + tst-tlsmod14b \ + tst-tlsmod15a \ + tst-tlsmod15b \ + tst-tlsmod16a \ + tst-tlsmod16b \ + tst-tlsmod17b \ + tst-tlsmod2 \ + tst-tlsmod3 \ + tst-tlsmod4 \ + tst-tlsmod5 \ + tst-tlsmod6 \ + tst-tlsmod7 \ + tst-tlsmod8 \ + tst-tlsmod9 \ + tst-unique1mod1 \ + tst-unique1mod2 \ + tst-unique2mod1 \ + tst-unique2mod2 \ + tst-unwind-ctor-lib \ + unload2dep \ + unload2mod \ + unload3mod1 \ + unload3mod2 \ + unload3mod3 \ + unload3mod4 \ + unload4mod1 \ + unload4mod2 \ + unload4mod3 \ + unload4mod4 \ + unload6mod1 \ + unload6mod2 \ + unload6mod3 \ + unload7mod1 \ + unload7mod2 \ + unload8mod1 \ + unload8mod1x \ + unload8mod2 \ + unload8mod3 \ + unloadmod \ + vismod1 \ + vismod2 \ + vismod3 \ + +modules-names-cxx = \ + tst-dlopen-nodelete-reloc-mod1 \ + tst-dlopen-nodelete-reloc-mod10 \ + tst-dlopen-nodelete-reloc-mod11 \ + tst-dlopen-nodelete-reloc-mod12 \ + tst-dlopen-nodelete-reloc-mod13 \ + tst-dlopen-nodelete-reloc-mod14 \ + tst-dlopen-nodelete-reloc-mod15 \ + tst-dlopen-nodelete-reloc-mod16 \ + tst-dlopen-nodelete-reloc-mod17 \ + tst-dlopen-nodelete-reloc-mod2 \ + tst-dlopen-nodelete-reloc-mod3 \ + tst-dlopen-nodelete-reloc-mod4 \ + tst-dlopen-nodelete-reloc-mod5 \ + tst-dlopen-nodelete-reloc-mod6 \ + tst-dlopen-nodelete-reloc-mod7 \ + tst-dlopen-nodelete-reloc-mod8 \ + tst-dlopen-nodelete-reloc-mod9 \ + tst-nodelete-rtldmod \ + tst-nodelete-uniquemod \ + tst-nodelete-zmod \ + tst-unique3lib \ + tst-unique3lib2 \ + tst-unique4lib \ + +modules-names += \ + $(if $(CXX),$(modules-names-cxx)) \ + $(modules-execstack-$(have-z-execstack)) \ + $(tst-tls-many-dynamic-modules) \ + $(tst-tls-many-dynamic-modules-dep) \ + $(tst-tls-many-dynamic-modules-dep-bad) \ + $(tlsmod17a-modules) \ + $(tlsmod18a-modules) \ # Most modules build with _ISOMAC defined, but those filtered out # depend on internal headers. From patchwork Mon Dec 13 17:55:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 48880 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 DC722385842E for ; Mon, 13 Dec 2021 17:58:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC722385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639418305; bh=GJC6pm7sZ1n3YhAKpDTNUQslyL3QMph2FpsJhietDCo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PuxUtZ+GdR9mrwspKT0NUoVdfxxYYcbEVL2aIOAhOz7zFr1eUWkWfdFIA9IbLCsHw UsIg5MLLyOLCTxa1agazQUdze6l5SL/8NpX71JX9SKyDFzJflDyi07d9EgoB9Y7mHs ttvHwDu/HycdDoZHjQH63I5ZMjfnKEy0k/xK8e20= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id C8ABD3858424 for ; Mon, 13 Dec 2021 17:55:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C8ABD3858424 Received: by mail-pj1-x102a.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so13988978pjb.1 for ; Mon, 13 Dec 2021 09:55:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GJC6pm7sZ1n3YhAKpDTNUQslyL3QMph2FpsJhietDCo=; b=0JSoKDAtghoXJM8ncIpUch7H2CGf8USmpcp4PK6c9HamzY9N4LbLSQeYJkLr5i3fBF beJesrysYllVHMHbNjZ2wrPI8Mnjm2Bnj0dZhmjIADth87c/3hTgILRRs9v9c3OjIY71 FxsvUM1077p8dn2/FoWdjXjxVKffaNi5+K3K9fwRMwX/dfpPeBmnVv9fWj2Pcx2wSpD9 10bGmJ1MTA1h3vyophiJdBcC3YTql0G9RXE+uVpiVsiBFYNHeV/W7msNfk6DJGw5ePK2 OQuDIExV6waqb5VqKzij2Xzyj016iEVQ1rKcPrC0mK89GuQE0cFgwPQFSW5sg5zSPaHk 3G8A== X-Gm-Message-State: AOAM533ER/vC76Txw0jwvvaTkBLpMNu3m2jpBtYxwBDLfWmfJSSzbBRY U1XQRQgSN8f431EMgWpofLo= X-Google-Smtp-Source: ABdhPJy2u8R1bhBCkF8qr4u8X00eIkSo9i7z/j2qU0L7VKtsLQzwRY2WL0TWuzOs9nCztqNOnmBMtA== X-Received: by 2002:a17:902:c713:b0:141:bc54:f32c with SMTP id p19-20020a170902c71300b00141bc54f32cmr96434834plp.82.1639418110721; Mon, 13 Dec 2021 09:55:10 -0800 (PST) Received: from gnu-cfl-2.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id on5sm7911007pjb.23.2021.12.13.09.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 09:55:10 -0800 (PST) Received: from gnu-tgl-3.localdomain (gnu-tgl-3 [192.168.1.57]) by gnu-cfl-2.localdomain (Postfix) with ESMTPS id 4D1A3420952; Mon, 13 Dec 2021 09:55:09 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 3139EC0B82; Mon, 13 Dec 2021 09:55:08 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v4 2/2] Add and use link-test-modules-rpath-link [BZ #28455] Date: Mon, 13 Dec 2021 09:55:08 -0800 Message-Id: <20211213175508.243761-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213175508.243761-1-hjl.tools@gmail.com> References: <20211213175508.243761-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3029.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" DT_RUNPATH is only used to find the immediate dependencies of the executable or shared object containing the DT_RUNPATH entry: 1. Define link-test-modules-rpath-link if $(build-hardcoded-path-in-tests) is yes. 2. Use $(link-test-modules-rpath-link) in build-module-helper so that test modules can dlopen modules with DT_RUNPATH. 3. Add a test to show why link-test-modules-rpath-link is needed. This partially fixes BZ #28455. --- Makeconfig | 2 ++ Makerules | 1 + elf/Makefile | 7 +++++++ elf/tst-global2.c | 32 ++++++++++++++++++++++++++++++++ elf/tst-globalmod2.c | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 elf/tst-global2.c create mode 100644 elf/tst-globalmod2.c diff --git a/Makeconfig b/Makeconfig index 775bf12b65..618d3dc627 100644 --- a/Makeconfig +++ b/Makeconfig @@ -575,8 +575,10 @@ link-libc-rpath-link = -Wl,-rpath-link=$(rpath-link) # build-hardcoded-path-in-tests. ifeq (yes,$(build-hardcoded-path-in-tests)) link-libc-tests-rpath-link = $(link-libc-rpath) +link-test-modules-rpath-link = $(link-libc-rpath) else link-libc-tests-rpath-link = $(link-libc-rpath-link) +link-test-modules-rpath-link = endif # build-hardcoded-path-in-tests link-libc-between-gnulib = $(common-objpfx)libc.so$(libc.so-version) \ diff --git a/Makerules b/Makerules index 8db0ca1296..7afba30039 100644 --- a/Makerules +++ b/Makerules @@ -591,6 +591,7 @@ $(LINK.o) -shared -static-libgcc $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \ $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) \ -B$(csu-objpfx) $(load-map-file) \ $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ + $(link-test-modules-rpath-link) \ -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) endef diff --git a/elf/Makefile b/elf/Makefile index 10556c3a7e..5694bb4e3c 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -270,6 +270,7 @@ tests += \ tst-glibc-hwcaps-mask \ tst-glibc-hwcaps-prepend \ tst-global1 \ + tst-global2 \ tst-initfinilazyfail \ tst-initorder \ tst-initorder2 \ @@ -510,6 +511,7 @@ modules-names = \ tst-filterobj-filtee \ tst-filterobj-flt \ tst-finilazyfailmod \ + tst-globalmod2 \ tst-initlazyfailmod \ tst-initorder2a \ tst-initorder2b \ @@ -1583,6 +1585,11 @@ tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so +$(objpfx)tst-global2: $(objpfx)tst-globalmod2.so +$(objpfx)tst-global2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so +LDFLAGS-tst-global2 = -Wl,--enable-new-dtags +LDFLAGS-tst-globalmod2.so = -Wl,--enable-new-dtags + $(objpfx)order2.out: $(objpfx)order2mod1.so $(objpfx)order2mod2.so $(objpfx)order2-cmp.out: $(objpfx)order2.out (echo "12345" | cmp $< -) > $@; \ diff --git a/elf/tst-global2.c b/elf/tst-global2.c new file mode 100644 index 0000000000..e929f526f4 --- /dev/null +++ b/elf/tst-global2.c @@ -0,0 +1,32 @@ +/* Test BZ #28455. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* In glibc configured with --enable-hardcoded-path-in-tests, a test + program built with -Wl,--enable-new-dtags, which adds DT_RUNPATH, + instead of DT_RPATH, can call a function in a shared library, which + dlopens another shared library. */ + +extern int test (void); + +static int +do_test (void) +{ + return test (); +} + +#include diff --git a/elf/tst-globalmod2.c b/elf/tst-globalmod2.c new file mode 100644 index 0000000000..6fd70a72a8 --- /dev/null +++ b/elf/tst-globalmod2.c @@ -0,0 +1,41 @@ +/* Test BZ #28455. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* In glibc configured with --enable-hardcoded-path-in-tests, a test + program built with -Wl,--enable-new-dtags, which adds DT_RUNPATH, + instead of DT_RPATH, can call a function in a shared library, which + dlopens another shared library. */ + +#include +#include +#include + +extern int test (void); + +int +test (void) +{ + (void) dlopen ("reldepmod4.so", RTLD_LAZY | RTLD_GLOBAL); + if (dlsym (RTLD_DEFAULT, "call_me") != NULL) + { + puts ("found \"call_me\""); + return EXIT_SUCCESS; + } + puts ("didn't find \"call_me\""); + return EXIT_FAILURE; +}