83f30e
commit e6fd79f3795d46dfb583e124be49fc063bc3d58b
83f30e
Author: Chung-Lin Tang <cltang@codesourcery.com>
83f30e
Date:   Thu Oct 21 21:41:21 2021 +0800
83f30e
83f30e
    elf: Testing infrastructure for ld.so DSO sorting (BZ #17645)
83f30e
    
83f30e
    This is the first of a 2-part patch set that fixes slow DSO sorting behavior in
83f30e
    the dynamic loader, as reported in BZ #17645. In order to facilitate such a
83f30e
    large modification to the dynamic loader, this first patch implements a testing
83f30e
    framework for validating shared object sorting behavior, to enable comparison
83f30e
    between old/new sorting algorithms, and any later enhancements.
83f30e
    
83f30e
    This testing infrastructure consists of a Python script
83f30e
    scripts/dso-ordering-test.py' which takes in a description language, consisting
83f30e
    of strings that describe a set of link dependency relations between DSOs, and
83f30e
    generates testcase programs and Makefile fragments to automatically test the
83f30e
    described situation, for example:
83f30e
    
83f30e
      a->b->c->d          # four objects linked one after another
83f30e
    
83f30e
      a->[bc]->d;b->c     # a depends on b and c, which both depend on d,
83f30e
                          # b depends on c (b,c linked to object a in fixed order)
83f30e
    
83f30e
      a->b->c;{+a;%a;-a}  # a, b, c serially dependent, main program uses
83f30e
                          # dlopen/dlsym/dlclose on object a
83f30e
    
83f30e
      a->b->c;{}!->[abc]  # a, b, c serially dependent; multiple tests generated
83f30e
                          # to test all permutations of a, b, c ordering linked
83f30e
                          # to main program
83f30e
    
83f30e
     (Above is just a short description of what the script can do, more
83f30e
      documentation is in the script comments.)
83f30e
    
83f30e
    Two files containing several new tests, elf/dso-sort-tests-[12].def are added,
83f30e
    including test scenarios for BZ #15311 and Redhat issue #1162810 [1].
83f30e
    
83f30e
    Due to the nature of dynamic loader tests, where the sorting behavior and test
83f30e
    output occurs before/after main(), generating testcases to use
83f30e
    support/test-driver.c does not suffice to control meaningful timeout for ld.so.
83f30e
    Therefore a new utility program 'support/test-run-command', based on
83f30e
    test-driver.c/support_test_main.c has been added. This does the same testcase
83f30e
    control, but for a program specified through a command-line rather than at the
83f30e
    source code level. This utility is used to run the dynamic loader testcases
83f30e
    generated by dso-ordering-test.py.
83f30e
    
83f30e
    [1] https://bugzilla.redhat.com/show_bug.cgi?id=1162810
83f30e
    
83f30e
    Signed-off-by: Chung-Lin Tang  <cltang@codesourcery.com>
83f30e
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
83f30e
83f30e
diff --git a/elf/Makefile b/elf/Makefile
83f30e
index 1fdf40cbd49e233e..e92f62f279566684 100644
83f30e
--- a/elf/Makefile
83f30e
+++ b/elf/Makefile
83f30e
@@ -986,6 +986,21 @@ tests-special += \
83f30e
   # tests-special
83f30e
 endif
83f30e
 
83f30e
+# DSO sorting tests:
83f30e
+# The dso-ordering-test.py script generates testcase source files in $(objpfx),
83f30e
+# creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
83f30e
+# Makefile fragment to be included.
83f30e
+define include_dsosort_tests
83f30e
+$(objpfx)$(1).generated-makefile: $(1)
83f30e
+	$(PYTHON) $(..)scripts/dso-ordering-test.py \
83f30e
+	--description-file $$< --objpfx $(objpfx) --output-makefile $$@
83f30e
+include $(objpfx)$(1).generated-makefile
83f30e
+endef
83f30e
+
83f30e
+# Generate from each testcase description file
83f30e
+$(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
83f30e
+$(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
83f30e
+
83f30e
 check-abi: $(objpfx)check-abi-ld.out
83f30e
 tests-special += $(objpfx)check-abi-ld.out
83f30e
 update-abi: update-abi-ld
83f30e
diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
83f30e
new file mode 100644
83f30e
index 0000000000000000..873ddf55d91155c6
83f30e
--- /dev/null
83f30e
+++ b/elf/dso-sort-tests-1.def
83f30e
@@ -0,0 +1,66 @@
83f30e
+# DSO sorting test descriptions.
83f30e
+# This file is to be processed by ../scripts/dso-ordering-test.py, see usage
83f30e
+# in elf/Makefile for how it is executed.
83f30e
+
83f30e
+# We test both dynamic loader sorting algorithms
83f30e
+tunable_option: glibc.rtld.dynamic_sort=1
83f30e
+tunable_option: glibc.rtld.dynamic_sort=2
83f30e
+
83f30e
+# Sequence of single dependencies with no cycles.
83f30e
+tst-dso-ordering1: a->b->c
83f30e
+output: c>b>a>{}
83f30e
+
83f30e
+# Sequence including 2 dependent DSOs not at the end of the graph.
83f30e
+tst-dso-ordering2: a->b->[cd]->e
83f30e
+output: e>d>c>b>a>{}
83f30e
+
83f30e
+# Complex order with 3 "layers" of full dependencies
83f30e
+tst-dso-ordering3: a->[bc]->[def]->[gh]->i
83f30e
+output: i>h>g>f>e>d>c>b>a>{}
83f30e
+
83f30e
+# Sequence including 2 dependent DSOs at the end of the graph.
83f30e
+# Additionally the same dependencies appear in two paths.
83f30e
+tst-dso-ordering4: a->b->[de];a->c->d->e
83f30e
+output: e>d>c>b>a>{}
83f30e
+
83f30e
+# Test that b->c cross link is respected correctly
83f30e
+tst-dso-ordering5: a!->[bc]->d;b->c
83f30e
+output: d>c>b>a>{}
83f30e
+
83f30e
+# First DSO fully dependent on 4 DSOs, with another DSO at the end of chain.
83f30e
+tst-dso-ordering6: a->[bcde]->f
83f30e
+output: f>e>d>c>b>a>{}
83f30e
+
83f30e
+# Sequence including 2 dependent and 3 dependent DSOs, and one of the
83f30e
+# dependent DSOs is dependent on an earlier DSO.
83f30e
+tst-dso-ordering7: a->[bc];b->[cde];e->f
83f30e
+output: f>e>d>c>b>a>{}
83f30e
+
83f30e
+# Sequence where the DSO c is unerlinked and calls a function in DSO a which
83f30e
+# is technically a cycle.  The main executable depends on the first two DSOs.
83f30e
+# Note: This test has unspecified behavior.
83f30e
+tst-dso-ordering8: a->b->c=>a;{}->[ba]
83f30e
+output: c>b>a>{}
83f30e
+
83f30e
+# Generate the permutation of DT_NEEDED order between the main binary and
83f30e
+# all 5 DSOs; all link orders should produce exact same init/fini ordering
83f30e
+tst-dso-ordering9: a->b->c->d->e;{}!->[abcde]
83f30e
+output: e>d>c>b>a>{}
83f30e
+
83f30e
+# Test if init/fini ordering behavior is proper, despite main program with
83f30e
+# an soname that may cause confusion
83f30e
+tst-dso-ordering10: {}->a->b->c;soname({})=c
83f30e
+output: b>a>{}
83f30e
+
83f30e
+# Complex example from Bugzilla #15311, under-linked and with circular
83f30e
+# relocation(dynamic) dependencies. While this is technically unspecified, the
83f30e
+# presumed reasonable practical behavior is for the destructor order to respect
83f30e
+# the static DT_NEEDED links (here this means the a->b->c->d order).
83f30e
+# The older dynamic_sort=1 algorithm does not achieve this, while the DFS-based
83f30e
+# dynamic_sort=2 algorithm does, although it is still arguable whether going
83f30e
+# beyond spec to do this is the right thing to do.
83f30e
+# The below expected outputs are what the two algorithms currently produce
83f30e
+# respectively, for regression testing purposes.
83f30e
+tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
83f30e
+xfail_output(glibc.rtld.dynamic_sort=1): {+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[
83f30e
+output(glibc.rtld.dynamic_sort=2): {+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[
83f30e
diff --git a/elf/dso-sort-tests-2.def b/elf/dso-sort-tests-2.def
83f30e
new file mode 100644
83f30e
index 0000000000000000..b79e79ecb7dc3dbf
83f30e
--- /dev/null
83f30e
+++ b/elf/dso-sort-tests-2.def
83f30e
@@ -0,0 +1,614 @@
83f30e
+# Large DSO sorting testcase adapted from Red Hat Bugzilla 1162810
83f30e
+#
83f30e
+# Note that below we specify different expected outputs between dynamic_sort=1
83f30e
+# and dynamic_sort=2 algorithms, due to circular dependencies in the testcase
83f30e
+# causing different sorting behavior.  These expected outputs are what the two
83f30e
+# algorithms currently produce, and are used for regression comparison tests.
83f30e
+# They are not "definitively" correct outputs, for circular dependencies
83f30e
+# inherently have unspecified behavior.
83f30e
+
83f30e
+xtest(tst-redhat-1162810):
83f30e
+{}->A101
83f30e
+{}->*
83f30e
+A101->(B101 B163 B122 B181)
83f30e
+A102->(B102 B140 B199 B158)
83f30e
+A103->(B103 B117 B176 B135)
83f30e
+A104->(B104 B194 B153 B112)
83f30e
+A105->(B105 B171 B130 B189)
83f30e
+A106->(B106 B148 B107 B166)
83f30e
+A107->(B107 B125 B184 B143)
83f30e
+A108->(B108 B102 B161 B120)
83f30e
+A109->(B109 B179 B138 B197)
83f30e
+A110->(B110 B156 B115 B174)
83f30e
+A111->(B111 B133 B192 B151)
83f30e
+A112->(B112 B110 B169 B128)
83f30e
+A113->(B113 B187 B146 B105)
83f30e
+A114->(B114 B164 B123 B182)
83f30e
+A115->(B115 B141 B200 B159)
83f30e
+A116->(B116 B118 B177 B136)
83f30e
+A117->(B117 B195 B154 B113)
83f30e
+A118->(B118 B172 B131 B190)
83f30e
+A119->(B119 B149 B108 B167)
83f30e
+A120->(B120 B126 B185 B144)
83f30e
+A121->(B121 B103 B162)
83f30e
+A122->(B122 B180 B139 B198)
83f30e
+A123->(B123 B157 B116 B175)
83f30e
+A124->(B124 B134 B193 B152)
83f30e
+A125->(B125 B111 B170 B129)
83f30e
+A126->(B126 B188 B147 B106)
83f30e
+A127->(B127 B165 B124 B183)
83f30e
+A128->(B128 B142 B101 B160)
83f30e
+A129->(B129 B119 B178 B137)
83f30e
+A130->(B130 B196 B155 B114)
83f30e
+A131->(B131 B173 B132 B191)
83f30e
+A132->(B132 B150 B109 B168)
83f30e
+A133->(B133 B127 B186 B145)
83f30e
+A134->(B134 B104 B163 B122)
83f30e
+A135->(B135 B181 B140 B199)
83f30e
+A136->(B136 B158 B117 B176)
83f30e
+A137->(B137 B135 B194 B153)
83f30e
+A138->(B138 B112 B171 B130)
83f30e
+A139->(B139 B189 B148 B107)
83f30e
+A140->(B140 B166 B125 B184)
83f30e
+A141->(B141 B143 B102 B161)
83f30e
+A142->(B142 B120 B179 B138)
83f30e
+A143->(B143 B197 B156 B115)
83f30e
+A144->(B144 B174 B133 B192)
83f30e
+A145->(B145 B151 B110 B169)
83f30e
+A146->(B146 B128 B187)
83f30e
+A147->(B147 B105 B164 B123)
83f30e
+A148->(B148 B182 B141 B200)
83f30e
+A149->(B149 B159 B118 B177)
83f30e
+A150->(B150 B136 B195 B154)
83f30e
+A151->(B151 B113 B172 B131)
83f30e
+A152->(B152 B190 B149 B108)
83f30e
+A153->(B153 B167 B126 B185)
83f30e
+A154->(B154 B144 B103 B162)
83f30e
+A155->(B155 B121 B180 B139)
83f30e
+A156->(B156 B198 B157 B116)
83f30e
+A157->(B157 B175 B134 B193)
83f30e
+A158->(B158 B152 B111 B170)
83f30e
+A159->(B159 B129 B188 B147)
83f30e
+A160->(B160 B106 B165 B124)
83f30e
+A161->(B161 B183 B142 B101)
83f30e
+A162->(B162 B160 B119 B178)
83f30e
+A163->(B163 B137 B196 B155)
83f30e
+A164->(B164 B114 B173 B132)
83f30e
+A165->(B165 B191 B150 B109)
83f30e
+A166->(B166 B168 B127 B186)
83f30e
+A167->(B167 B145 B104 B163)
83f30e
+A168->(B168 B122 B181 B140)
83f30e
+A169->(B169 B199 B158 B117)
83f30e
+A170->(B170 B176 B135 B194)
83f30e
+A171->(B171 B153 B112)
83f30e
+A172->(B172 B130 B189 B148)
83f30e
+A173->(B173 B107 B166 B125)
83f30e
+A174->(B174 B184 B143 B102)
83f30e
+A175->(B175 B161 B120 B179)
83f30e
+A176->(B176 B138 B197 B156)
83f30e
+A177->(B177 B115 B174 B133)
83f30e
+A178->(B178 B192 B151 B110)
83f30e
+A179->(B179 B169 B128 B187)
83f30e
+A180->(B180 B146 B105 B164)
83f30e
+A181->(B181 B123 B182 B141)
83f30e
+A182->(B182 B200 B159 B118)
83f30e
+A183->(B183 B177 B136 B195)
83f30e
+A184->(B184 B154 B113 B172)
83f30e
+A185->(B185 B131 B190 B149)
83f30e
+A186->(B186 B108 B167 B126)
83f30e
+A187->(B187 B185 B144 B103)
83f30e
+A188->(B188 B162 B121 B180)
83f30e
+A189->(B189 B139 B198 B157)
83f30e
+A190->(B190 B116 B175 B134)
83f30e
+A191->(B191 B193 B152 B111)
83f30e
+A192->(B192 B170 B129 B188)
83f30e
+A193->(B193 B147 B106 B165)
83f30e
+A194->(B194 B124 B183 B142)
83f30e
+A195->(B195 B101 B160 B119)
83f30e
+A196->(B196 B178 B137)
83f30e
+A197->(B197 B155 B114 B173)
83f30e
+A198->(B198 B132 B191 B150)
83f30e
+A199->(B199 B109 B168 B127)
83f30e
+A200->(B200 B186 B145 B104)
83f30e
+B101->(C101 C164 C123 C182)
83f30e
+B102->(C102 C141 C200 C159)
83f30e
+B103->(C103 C118 C177 C136)
83f30e
+B104->(C104 C195 C154 C113)
83f30e
+B105->(C105 C172 C131 C190)
83f30e
+B106->(C106 C149 C108 C167)
83f30e
+B107->(C107 C126 C185 C144)
83f30e
+B108->(C108 C103 C162 C121)
83f30e
+B109->(C109 C180 C139 C198)
83f30e
+B110->(C110 C157 C116 C175)
83f30e
+B111->(C111 C134 C193 C152)
83f30e
+B112->(C112 C111 C170 C129)
83f30e
+B113->(C113 C188 C147 C106)
83f30e
+B114->(C114 C165 C124 C183)
83f30e
+B115->(C115 C142 C101 C160)
83f30e
+B116->(C116 C119 C178 C137)
83f30e
+B117->(C117 C196 C155 C114)
83f30e
+B118->(C118 C173 C132 C191)
83f30e
+B119->(C119 C150 C109 C168)
83f30e
+B120->(C120 C127 C186 C145)
83f30e
+B121->(C121 C104 C163 C122)
83f30e
+B122->(C122 C181 C140 C199)
83f30e
+B123->(C123 C158 C117 C176)
83f30e
+B124->(C124 C135 C194 C153)
83f30e
+B125->(C125 C112 C171 C130)
83f30e
+B126->(C126 C189 C148 C107)
83f30e
+B127->(C127 C166 C125 C184)
83f30e
+B128->(C128 C143 C102 C161)
83f30e
+B129->(C129 C120 C179 C138)
83f30e
+B130->(C130 C197 C156 C115)
83f30e
+B131->(C131 C174 C133 C192)
83f30e
+B132->(C132 C151 C110 C169)
83f30e
+B133->(C133 C128 C187 C146)
83f30e
+B134->(C134 C105 C164 C123)
83f30e
+B135->(C135 C182 C141 C200)
83f30e
+B136->(C136 C159 C118 C177)
83f30e
+B137->(C137 C136 C195 C154)
83f30e
+B138->(C138 C113 C172 C131)
83f30e
+B139->(C139 C190 C149 C108)
83f30e
+B140->(C140 C167 C126 C185)
83f30e
+B141->(C141 C144 C103 C162)
83f30e
+B142->(C142 C121 C180 C139)
83f30e
+B143->(C143 C198 C157 C116)
83f30e
+B144->(C144 C175 C134 C193)
83f30e
+B145->(C145 C152 C111 C170)
83f30e
+B146->(C146 C129 C188 C147)
83f30e
+B147->(C147 C106 C165 C124)
83f30e
+B148->(C148 C183 C142 C101)
83f30e
+B149->(C149 C160 C119 C178)
83f30e
+B150->(C150 C137 C196 C155)
83f30e
+B151->(C151 C114 C173 C132)
83f30e
+B152->(C152 C191 C150 C109)
83f30e
+B153->(C153 C168 C127 C186)
83f30e
+B154->(C154 C145 C104 C163)
83f30e
+B155->(C155 C122 C181 C140)
83f30e
+B156->(C156 C199 C158 C117)
83f30e
+B157->(C157 C176 C135 C194)
83f30e
+B158->(C158 C153 C112 C171)
83f30e
+B159->(C159 C130 C189 C148)
83f30e
+B160->(C160 C107 C166 C125)
83f30e
+B161->(C161 C184 C143 C102)
83f30e
+B162->(C162 C161 C120 C179)
83f30e
+B163->(C163 C138 C197 C156)
83f30e
+B164->(C164 C115 C174 C133)
83f30e
+B165->(C165 C192 C151 C110)
83f30e
+B166->(C166 C169 C128 C187)
83f30e
+B167->(C167 C146 C105 C164)
83f30e
+B168->(C168 C123 C182 C141)
83f30e
+B169->(C169 C200 C159 C118)
83f30e
+B170->(C170 C177 C136 C195)
83f30e
+B171->(C171 C154 C113 C172)
83f30e
+B172->(C172 C131 C190 C149)
83f30e
+B173->(C173 C108 C167 C126)
83f30e
+B174->(C174 C185 C144 C103)
83f30e
+B175->(C175 C162 C121 C180)
83f30e
+B176->(C176 C139 C198 C157)
83f30e
+B177->(C177 C116 C175 C134)
83f30e
+B178->(C178 C193 C152 C111)
83f30e
+B179->(C179 C170 C129 C188)
83f30e
+B180->(C180 C147 C106 C165)
83f30e
+B181->(C181 C124 C183 C142)
83f30e
+B182->(C182 C101 C160 C119)
83f30e
+B183->(C183 C178 C137 C196)
83f30e
+B184->(C184 C155 C114 C173)
83f30e
+B185->(C185 C132 C191 C150)
83f30e
+B186->(C186 C109 C168 C127)
83f30e
+B187->(C187 C186 C145 C104)
83f30e
+B188->(C188 C163 C122 C181)
83f30e
+B189->(C189 C140 C199 C158)
83f30e
+B190->(C190 C117 C176 C135)
83f30e
+B191->(C191 C194 C153 C112)
83f30e
+B192->(C192 C171 C130 C189)
83f30e
+B193->(C193 C148 C107 C166)
83f30e
+B194->(C194 C125 C184 C143)
83f30e
+B195->(C195 C102 C161 C120)
83f30e
+B196->(C196 C179 C138 C197)
83f30e
+B197->(C197 C156 C115 C174)
83f30e
+B198->(C198 C133 C192 C151)
83f30e
+B199->(C199 C110 C169 C128)
83f30e
+B200->(C200 C187 C146 C105)
83f30e
+C101->(A165 A124)
83f30e
+C102->(A183 A142)
83f30e
+C103->(A101 A160)
83f30e
+C104->(A119 A178)
83f30e
+C105->(A137 A196)
83f30e
+C106->(A155 A114)
83f30e
+C107->(A173 A132)
83f30e
+C108->(A191 A150)
83f30e
+C109->(A109 A168)
83f30e
+C110->(A127 A186)
83f30e
+C111->(A145 A104)
83f30e
+C112->(A163 A122)
83f30e
+C113->(A181 A140)
83f30e
+C114->(A199 A158)
83f30e
+C115->(A117 A176)
83f30e
+C116->(A135 A194)
83f30e
+C117->(A153 A112)
83f30e
+C118->(A171 A130)
83f30e
+C119->(A189 A148)
83f30e
+C120->(A107 A166)
83f30e
+C121->(A125 A184)
83f30e
+C122->(A143 A102)
83f30e
+C123->(A161 A120)
83f30e
+C124->(A179 A138)
83f30e
+C125->(A197 A156)
83f30e
+C126->(A115 A174)
83f30e
+C127->(A133 A192)
83f30e
+C128->(A151 A110)
83f30e
+C129->(A169 A128)
83f30e
+C130->(A187 A146)
83f30e
+C131->(A105 A164)
83f30e
+C132->(A123 A182)
83f30e
+C133->(A141 A200)
83f30e
+C134->(A159 A118)
83f30e
+C135->(A177 A136)
83f30e
+C136->(A195 A154)
83f30e
+C137->(A113 A172)
83f30e
+C138->(A131 A190)
83f30e
+C139->(A149 A108)
83f30e
+C140->(A167 A126)
83f30e
+C141->(A185 A144)
83f30e
+C142->(A103 A162)
83f30e
+C143->(A121 A180)
83f30e
+C144->(A139 A198)
83f30e
+C145->(A157 A116)
83f30e
+C146->(A175 A134)
83f30e
+C147->(A193 A152)
83f30e
+C148->(A111 A170)
83f30e
+C149->(A129 A188)
83f30e
+C150->(A147 A106)
83f30e
+C151->(A165 A124)
83f30e
+C152->(A183 A142)
83f30e
+C153->(A101 A160)
83f30e
+C154->(A119 A178)
83f30e
+C155->(A137 A196)
83f30e
+C156->(A155 A114)
83f30e
+C157->(A173 A132)
83f30e
+C158->(A191 A150)
83f30e
+C159->(A109 A168)
83f30e
+C160->(A127 A186)
83f30e
+C161->(A145 A104)
83f30e
+C162->(A163 A122)
83f30e
+C163->(A181 A140)
83f30e
+C164->(A199 A158)
83f30e
+C165->(A117 A176)
83f30e
+C166->(A135 A194)
83f30e
+C167->(A153 A112)
83f30e
+C168->(A171 A130)
83f30e
+C169->(A189 A148)
83f30e
+C170->(A107 A166)
83f30e
+C171->(A125 A184)
83f30e
+C172->(A143 A102)
83f30e
+C173->(A161 A120)
83f30e
+C174->(A179 A138)
83f30e
+C175->(A197 A156)
83f30e
+C176->(A115 A174)
83f30e
+C177->(A133 A192)
83f30e
+C178->(A151 A110)
83f30e
+C179->(A169 A128)
83f30e
+C180->(A187 A146)
83f30e
+C181->(A105 A164)
83f30e
+C182->(A123 A182)
83f30e
+C183->(A141 A200)
83f30e
+C184->(A159 A118)
83f30e
+C185->(A177 A136)
83f30e
+C186->(A195 A154)
83f30e
+C187->(A113 A172)
83f30e
+C188->(A131 A190)
83f30e
+C189->(A149 A108)
83f30e
+C190->(A167 A126)
83f30e
+C191->(A185 A144)
83f30e
+C192->(A103 A162)
83f30e
+C193->(A121 A180)
83f30e
+C194->(A139 A198)
83f30e
+C195->(A157 A116)
83f30e
+C196->(A175 A134)
83f30e
+C197->(A193 A152)
83f30e
+C198->(A111 A170)
83f30e
+C199->(A129 A188)
83f30e
+C200->(A147 A106)
83f30e
+M11X11->(M13X14 M12X13 M12X12 M12X11)
83f30e
+M11X12->(M13X25 M12X24 M12X23 M12X22)
83f30e
+M11X13->(M13X21 M12X20 M12X19 M12X18)
83f30e
+M11X14->(M13X17 M12X16 M12X15 M12X14)
83f30e
+M11X15->(M13X13 M12X12 M12X11 M12X25)
83f30e
+M11X16->(M13X24 M12X23 M12X22 M12X21)
83f30e
+M11X17->(M13X20 M12X19 M12X18 M12X17)
83f30e
+M11X18->(M13X16 M12X15 M12X14 M12X13)
83f30e
+M11X19->(M13X12 M12X11 M12X25 M12X24)
83f30e
+M11X20->(M13X23 M12X22 M12X21 M12X20)
83f30e
+M11X21->(M13X19 M12X18 M12X17 M12X16)
83f30e
+M11X22->(M13X15 M12X14 M12X13 M12X12)
83f30e
+M11X23->(M13X11 M12X25 M12X24 M12X23)
83f30e
+M11X24->(M13X22 M12X21 M12X20 M12X19)
83f30e
+M11X25->(M13X18 M12X17 M12X16 M12X15)
83f30e
+M12X11->(M14X14 M13X13 M13X12 M13X11)
83f30e
+M12X12->(M14X25 M13X24 M13X23 M13X22)
83f30e
+M12X13->(M14X21 M13X20 M13X19 M13X18)
83f30e
+M12X14->(M14X17 M13X16 M13X15 M13X14)
83f30e
+M12X15->(M14X13 M13X12 M13X11 M13X25)
83f30e
+M12X16->(M14X24 M13X23 M13X22 M13X21)
83f30e
+M12X17->(M14X20 M13X19 M13X18 M13X17)
83f30e
+M12X18->(M14X16 M13X15 M13X14 M13X13)
83f30e
+M12X19->(M14X12 M13X11 M13X25 M13X24)
83f30e
+M12X20->(M14X23 M13X22 M13X21 M13X20)
83f30e
+M12X21->(M14X19 M13X18 M13X17 M13X16)
83f30e
+M12X22->(M14X15 M13X14 M13X13 M13X12)
83f30e
+M12X23->(M14X11 M13X25 M13X24 M13X23)
83f30e
+M12X24->(M14X22 M13X21 M13X20 M13X19)
83f30e
+M12X25->(M14X18 M13X17 M13X16 M13X15)
83f30e
+M13X11->(M15X14 M14X13 M14X12 M14X11)
83f30e
+M13X12->(M15X25 M14X24 M14X23 M14X22)
83f30e
+M13X13->(M15X21 M14X20 M14X19 M14X18)
83f30e
+M13X14->(M15X17 M14X16 M14X15 M14X14)
83f30e
+M13X15->(M15X13 M14X12 M14X11 M14X25)
83f30e
+M13X16->(M15X24 M14X23 M14X22 M14X21)
83f30e
+M13X17->(M15X20 M14X19 M14X18 M14X17)
83f30e
+M13X18->(M15X16 M14X15 M14X14 M14X13)
83f30e
+M13X19->(M15X12 M14X11 M14X25 M14X24)
83f30e
+M13X20->(M15X23 M14X22 M14X21 M14X20)
83f30e
+M13X21->(M15X19 M14X18 M14X17 M14X16)
83f30e
+M13X22->(M15X15 M14X14 M14X13 M14X12)
83f30e
+M13X23->(M15X11 M14X25 M14X24 M14X23)
83f30e
+M13X24->(M15X22 M14X21 M14X20 M14X19)
83f30e
+M13X25->(M15X18 M14X17 M14X16 M14X15)
83f30e
+M14X11->(M16X14 M15X13 M15X12 M15X11)
83f30e
+M14X12->(M16X25 M15X24 M15X23 M15X22)
83f30e
+M14X13->(M16X21 M15X20 M15X19 M15X18)
83f30e
+M14X14->(M16X17 M15X16 M15X15 M15X14)
83f30e
+M14X15->(M16X13 M15X12 M15X11 M15X25)
83f30e
+M14X16->(M16X24 M15X23 M15X22 M15X21)
83f30e
+M14X17->(M16X20 M15X19 M15X18 M15X17)
83f30e
+M14X18->(M16X16 M15X15 M15X14 M15X13)
83f30e
+M14X19->(M16X12 M15X11 M15X25 M15X24)
83f30e
+M14X20->(M16X23 M15X22 M15X21 M15X20)
83f30e
+M14X21->(M16X19 M15X18 M15X17 M15X16)
83f30e
+M14X22->(M16X15 M15X14 M15X13 M15X12)
83f30e
+M14X23->(M16X11 M15X25 M15X24 M15X23)
83f30e
+M14X24->(M16X22 M15X21 M15X20 M15X19)
83f30e
+M14X25->(M16X18 M15X17 M15X16 M15X15)
83f30e
+M15X11->(M17X14 M16X13 M16X12 M16X11)
83f30e
+M15X12->(M17X25 M16X24 M16X23 M16X22)
83f30e
+M15X13->(M17X21 M16X20 M16X19 M16X18)
83f30e
+M15X14->(M17X17 M16X16 M16X15 M16X14)
83f30e
+M15X15->(M17X13 M16X12 M16X11 M16X25)
83f30e
+M15X16->(M17X24 M16X23 M16X22 M16X21)
83f30e
+M15X17->(M17X20 M16X19 M16X18 M16X17)
83f30e
+M15X18->(M17X16 M16X15 M16X14 M16X13)
83f30e
+M15X19->(M17X12 M16X11 M16X25 M16X24)
83f30e
+M15X20->(M17X23 M16X22 M16X21 M16X20)
83f30e
+M15X21->(M17X19 M16X18 M16X17 M16X16)
83f30e
+M15X22->(M17X15 M16X14 M16X13 M16X12)
83f30e
+M15X23->(M17X11 M16X25 M16X24 M16X23)
83f30e
+M15X24->(M17X22 M16X21 M16X20 M16X19)
83f30e
+M15X25->(M17X18 M16X17 M16X16 M16X15)
83f30e
+M16X11->(M18X14 M17X13 M17X12 M17X11)
83f30e
+M16X12->(M18X25 M17X24 M17X23 M17X22)
83f30e
+M16X13->(M18X21 M17X20 M17X19 M17X18)
83f30e
+M16X14->(M18X17 M17X16 M17X15 M17X14)
83f30e
+M16X15->(M18X13 M17X12 M17X11 M17X25)
83f30e
+M16X16->(M18X24 M17X23 M17X22 M17X21)
83f30e
+M16X17->(M18X20 M17X19 M17X18 M17X17)
83f30e
+M16X18->(M18X16 M17X15 M17X14 M17X13)
83f30e
+M16X19->(M18X12 M17X11 M17X25 M17X24)
83f30e
+M16X20->(M18X23 M17X22 M17X21 M17X20)
83f30e
+M16X21->(M18X19 M17X18 M17X17 M17X16)
83f30e
+M16X22->(M18X15 M17X14 M17X13 M17X12)
83f30e
+M16X23->(M18X11 M17X25 M17X24 M17X23)
83f30e
+M16X24->(M18X22 M17X21 M17X20 M17X19)
83f30e
+M16X25->(M18X18 M17X17 M17X16 M17X15)
83f30e
+M17X11->(M19X14 M18X13 M18X12 M18X11)
83f30e
+M17X12->(M19X25 M18X24 M18X23 M18X22)
83f30e
+M17X13->(M19X21 M18X20 M18X19 M18X18)
83f30e
+M17X14->(M19X17 M18X16 M18X15 M18X14)
83f30e
+M17X15->(M19X13 M18X12 M18X11 M18X25)
83f30e
+M17X16->(M19X24 M18X23 M18X22 M18X21)
83f30e
+M17X17->(M19X20 M18X19 M18X18 M18X17)
83f30e
+M17X18->(M19X16 M18X15 M18X14 M18X13)
83f30e
+M17X19->(M19X12 M18X11 M18X25 M18X24)
83f30e
+M17X20->(M19X23 M18X22 M18X21 M18X20)
83f30e
+M17X21->(M19X19 M18X18 M18X17 M18X16)
83f30e
+M17X22->(M19X15 M18X14 M18X13 M18X12)
83f30e
+M17X23->(M19X11 M18X25 M18X24 M18X23)
83f30e
+M17X24->(M19X22 M18X21 M18X20 M18X19)
83f30e
+M17X25->(M19X18 M18X17 M18X16 M18X15)
83f30e
+M18X11->(M20X14 M19X13 M19X12 M19X11)
83f30e
+M18X12->(M20X25 M19X24 M19X23 M19X22)
83f30e
+M18X13->(M20X21 M19X20 M19X19 M19X18)
83f30e
+M18X14->(M20X17 M19X16 M19X15 M19X14)
83f30e
+M18X15->(M20X13 M19X12 M19X11 M19X25)
83f30e
+M18X16->(M20X24 M19X23 M19X22 M19X21)
83f30e
+M18X17->(M20X20 M19X19 M19X18 M19X17)
83f30e
+M18X18->(M20X16 M19X15 M19X14 M19X13)
83f30e
+M18X19->(M20X12 M19X11 M19X25 M19X24)
83f30e
+M18X20->(M20X23 M19X22 M19X21 M19X20)
83f30e
+M18X21->(M20X19 M19X18 M19X17 M19X16)
83f30e
+M18X22->(M20X15 M19X14 M19X13 M19X12)
83f30e
+M18X23->(M20X11 M19X25 M19X24 M19X23)
83f30e
+M18X24->(M20X22 M19X21 M19X20 M19X19)
83f30e
+M18X25->(M20X18 M19X17 M19X16 M19X15)
83f30e
+M19X11->(M21X14 M20X13 M20X12 M20X11)
83f30e
+M19X12->(M21X25 M20X24 M20X23 M20X22)
83f30e
+M19X13->(M21X21 M20X20 M20X19 M20X18)
83f30e
+M19X14->(M21X17 M20X16 M20X15 M20X14)
83f30e
+M19X15->(M21X13 M20X12 M20X11 M20X25)
83f30e
+M19X16->(M21X24 M20X23 M20X22 M20X21)
83f30e
+M19X17->(M21X20 M20X19 M20X18 M20X17)
83f30e
+M19X18->(M21X16 M20X15 M20X14 M20X13)
83f30e
+M19X19->(M21X12 M20X11 M20X25 M20X24)
83f30e
+M19X20->(M21X23 M20X22 M20X21 M20X20)
83f30e
+M19X21->(M21X19 M20X18 M20X17 M20X16)
83f30e
+M19X22->(M21X15 M20X14 M20X13 M20X12)
83f30e
+M19X23->(M21X11 M20X25 M20X24 M20X23)
83f30e
+M19X24->(M21X22 M20X21 M20X20 M20X19)
83f30e
+M19X25->(M21X18 M20X17 M20X16 M20X15)
83f30e
+M20X11->(M22X14 M21X13 M21X12 M21X11)
83f30e
+M20X12->(M22X25 M21X24 M21X23 M21X22)
83f30e
+M20X13->(M22X21 M21X20 M21X19 M21X18)
83f30e
+M20X14->(M22X17 M21X16 M21X15 M21X14)
83f30e
+M20X15->(M22X13 M21X12 M21X11 M21X25)
83f30e
+M20X16->(M22X24 M21X23 M21X22 M21X21)
83f30e
+M20X17->(M22X20 M21X19 M21X18 M21X17)
83f30e
+M20X18->(M22X16 M21X15 M21X14 M21X13)
83f30e
+M20X19->(M22X12 M21X11 M21X25 M21X24)
83f30e
+M20X20->(M22X23 M21X22 M21X21 M21X20)
83f30e
+M20X21->(M22X19 M21X18 M21X17 M21X16)
83f30e
+M20X22->(M22X15 M21X14 M21X13 M21X12)
83f30e
+M20X23->(M22X11 M21X25 M21X24 M21X23)
83f30e
+M20X24->(M22X22 M21X21 M21X20 M21X19)
83f30e
+M20X25->(M22X18 M21X17 M21X16 M21X15)
83f30e
+M21X11->(M23X15 M22X14 M22X13 M22X12)
83f30e
+M21X12->(M11X11 M23X25 M22X24 M22X23 M22X22)
83f30e
+M21X13->(M23X21 M22X20 M22X19 M22X18)
83f30e
+M21X14->(M23X17 M22X16 M22X15 M22X14)
83f30e
+M21X15->(M23X13 M22X12 M22X11 M22X25)
83f30e
+M21X16->(M23X24 M22X23 M22X22 M22X21)
83f30e
+M21X17->(M23X20 M22X19 M22X18 M22X17)
83f30e
+M21X18->(M23X16 M22X15 M22X14 M22X13)
83f30e
+M21X19->(M23X12 M22X11 M22X25 M22X24)
83f30e
+M21X20->(M23X23 M22X22 M22X21 M22X20)
83f30e
+M21X21->(M23X19 M22X18 M22X17 M22X16)
83f30e
+M21X22->(M23X15 M22X14 M22X13 M22X12)
83f30e
+M21X23->(M23X11 M22X25 M22X24 M22X23)
83f30e
+M21X24->(M23X22 M22X21 M22X20 M22X19)
83f30e
+M21X25->(M23X18 M22X17 M22X16 M22X15)
83f30e
+M22X11->(M24X16 M23X15 M23X14 M23X13)
83f30e
+M22X12->(M12X12 M24X11 M23X25 M23X24 M23X23)
83f30e
+M22X13->(M24X22 M23X21 M23X20 M23X19)
83f30e
+M22X14->(M24X18 M23X17 M23X16 M23X15)
83f30e
+M22X15->(M24X14 M23X13 M23X12 M23X11)
83f30e
+M22X16->(M24X25 M23X24 M23X23 M23X22)
83f30e
+M22X17->(M24X21 M23X20 M23X19 M23X18)
83f30e
+M22X18->(M24X17 M23X16 M23X15 M23X14)
83f30e
+M22X19->(M24X13 M23X12 M23X11 M23X25)
83f30e
+M22X20->(M24X24 M23X23 M23X22 M23X21)
83f30e
+M22X21->(M24X20 M23X19 M23X18 M23X17)
83f30e
+M22X22->(M24X16 M23X15 M23X14 M23X13)
83f30e
+M22X23->(M24X12 M23X11 M23X25 M23X24)
83f30e
+M22X24->(M24X23 M23X22 M23X21 M23X20)
83f30e
+M22X25->(M24X19 M23X18 M23X17 M23X16)
83f30e
+M23X11->(M25X17 M24X16 M24X15 M24X14)
83f30e
+M23X12->(M13X13 M25X12 M24X11 M24X25 M24X24)
83f30e
+M23X13->(M25X23 M24X22 M24X21 M24X20)
83f30e
+M23X14->(M25X19 M24X18 M24X17 M24X16)
83f30e
+M23X15->(M25X15 M24X14 M24X13 M24X12)
83f30e
+M23X16->(M25X11 M24X25 M24X24 M24X23)
83f30e
+M23X17->(M25X22 M24X21 M24X20 M24X19)
83f30e
+M23X18->(M25X18 M24X17 M24X16 M24X15)
83f30e
+M23X19->(M25X14 M24X13 M24X12 M24X11)
83f30e
+M23X20->(M25X25 M24X24 M24X23 M24X22)
83f30e
+M23X21->(M25X21 M24X20 M24X19 M24X18)
83f30e
+M23X22->(M25X17 M24X16 M24X15 M24X14)
83f30e
+M23X23->(M25X13 M24X12 M24X11 M24X25)
83f30e
+M23X24->(M25X24 M24X23 M24X22 M24X21)
83f30e
+M23X25->(M25X20 M24X19 M24X18 M24X17)
83f30e
+M24X11->(M26X18 M25X17 M25X16 M25X15)
83f30e
+M24X12->(M14X14 M26X13 M25X12 M25X11 M25X25)
83f30e
+M24X13->(M26X24 M25X23 M25X22 M25X21)
83f30e
+M24X14->(M26X20 M25X19 M25X18 M25X17)
83f30e
+M24X15->(M26X16 M25X15 M25X14 M25X13)
83f30e
+M24X16->(M26X12 M25X11 M25X25 M25X24)
83f30e
+M24X17->(M26X23 M25X22 M25X21 M25X20)
83f30e
+M24X18->(M26X19 M25X18 M25X17 M25X16)
83f30e
+M24X19->(M26X15 M25X14 M25X13 M25X12)
83f30e
+M24X20->(M26X11 M25X25 M25X24 M25X23)
83f30e
+M24X21->(M26X22 M25X21 M25X20 M25X19)
83f30e
+M24X22->(M26X18 M25X17 M25X16 M25X15)
83f30e
+M24X23->(M26X14 M25X13 M25X12 M25X11)
83f30e
+M24X24->(M26X25 M25X24 M25X23 M25X22)
83f30e
+M24X25->(M26X21 M25X20 M25X19 M25X18)
83f30e
+M25X11->(M27X19 M26X18 M26X17 M26X16)
83f30e
+M25X12->(M15X15 M27X14 M26X13 M26X12 M26X11)
83f30e
+M25X13->(M27X25 M26X24 M26X23 M26X22)
83f30e
+M25X14->(M27X21 M26X20 M26X19 M26X18)
83f30e
+M25X15->(M27X17 M26X16 M26X15 M26X14)
83f30e
+M25X16->(M27X13 M26X12 M26X11 M26X25)
83f30e
+M25X17->(M27X24 M26X23 M26X22 M26X21)
83f30e
+M25X18->(M27X20 M26X19 M26X18 M26X17)
83f30e
+M25X19->(M27X16 M26X15 M26X14 M26X13)
83f30e
+M25X20->(M27X12 M26X11 M26X25 M26X24)
83f30e
+M25X21->(M27X23 M26X22 M26X21 M26X20)
83f30e
+M25X22->(M27X19 M26X18 M26X17 M26X16)
83f30e
+M25X23->(M27X15 M26X14 M26X13 M26X12)
83f30e
+M25X24->(M27X11 M26X25 M26X24 M26X23)
83f30e
+M25X25->(M27X22 M26X21 M26X20 M26X19)
83f30e
+M26X11->(M28X20 M27X19 M27X18 M27X17)
83f30e
+M26X12->(M16X16 M28X15 M27X14 M27X13 M27X12)
83f30e
+M26X13->(M28X11 M27X25 M27X24 M27X23)
83f30e
+M26X14->(M28X22 M27X21 M27X20 M27X19)
83f30e
+M26X15->(M28X18 M27X17 M27X16 M27X15)
83f30e
+M26X16->(M28X14 M27X13 M27X12 M27X11)
83f30e
+M26X17->(M28X25 M27X24 M27X23 M27X22)
83f30e
+M26X18->(M28X21 M27X20 M27X19 M27X18)
83f30e
+M26X19->(M28X17 M27X16 M27X15 M27X14)
83f30e
+M26X20->(M28X13 M27X12 M27X11 M27X25)
83f30e
+M26X21->(M28X24 M27X23 M27X22 M27X21)
83f30e
+M26X22->(M28X20 M27X19 M27X18 M27X17)
83f30e
+M26X23->(M28X16 M27X15 M27X14 M27X13)
83f30e
+M26X24->(M28X12 M27X11 M27X25 M27X24)
83f30e
+M26X25->(M28X23 M27X22 M27X21 M27X20)
83f30e
+M27X11->(M29X21 M28X20 M28X19 M28X18)
83f30e
+M27X12->(M17X17 M29X16 M28X15 M28X14 M28X13)
83f30e
+M27X13->(M29X12 M28X11 M28X25 M28X24)
83f30e
+M27X14->(M29X23 M28X22 M28X21 M28X20)
83f30e
+M27X15->(M29X19 M28X18 M28X17 M28X16)
83f30e
+M27X16->(M29X15 M28X14 M28X13 M28X12)
83f30e
+M27X17->(M29X11 M28X25 M28X24 M28X23)
83f30e
+M27X18->(M29X22 M28X21 M28X20 M28X19)
83f30e
+M27X19->(M29X18 M28X17 M28X16 M28X15)
83f30e
+M27X20->(M29X14 M28X13 M28X12 M28X11)
83f30e
+M27X21->(M29X25 M28X24 M28X23 M28X22)
83f30e
+M27X22->(M29X21 M28X20 M28X19 M28X18)
83f30e
+M27X23->(M29X17 M28X16 M28X15 M28X14)
83f30e
+M27X24->(M29X13 M28X12 M28X11 M28X25)
83f30e
+M27X25->(M29X24 M28X23 M28X22 M28X21)
83f30e
+M28X11->(M30X22 M29X21 M29X20 M29X19)
83f30e
+M28X12->(M18X18 M30X17 M29X16 M29X15 M29X14)
83f30e
+M28X13->(M30X13 M29X12 M29X11 M29X25)
83f30e
+M28X14->(M30X24 M29X23 M29X22 M29X21)
83f30e
+M28X15->(M30X20 M29X19 M29X18 M29X17)
83f30e
+M28X16->(M30X16 M29X15 M29X14 M29X13)
83f30e
+M28X17->(M30X12 M29X11 M29X25 M29X24)
83f30e
+M28X18->(M30X23 M29X22 M29X21 M29X20)
83f30e
+M28X19->(M30X19 M29X18 M29X17 M29X16)
83f30e
+M28X20->(M30X15 M29X14 M29X13 M29X12)
83f30e
+M28X21->(M30X11 M29X25 M29X24 M29X23)
83f30e
+M28X22->(M30X22 M29X21 M29X20 M29X19)
83f30e
+M28X23->(M30X18 M29X17 M29X16 M29X15)
83f30e
+M28X24->(M30X14 M29X13 M29X12 M29X11)
83f30e
+M28X25->(M30X25 M29X24 M29X23 M29X22)
83f30e
+M29X11->(M30X22 M30X21 M30X20)
83f30e
+M29X12->(M30X17 M30X16 M30X15)
83f30e
+M29X13->(M30X13 M30X12 M30X11)
83f30e
+M29X14->(M30X24 M30X23 M30X22)
83f30e
+M29X15->(M30X20 M30X19 M30X18)
83f30e
+M29X16->(M30X16 M30X15 M30X14)
83f30e
+M29X17->(M30X12 M30X11 M30X25)
83f30e
+M29X18->(M30X23 M30X22 M30X21)
83f30e
+M29X19->(M30X19 M30X18 M30X17)
83f30e
+M29X20->(M30X15 M30X14 M30X13)
83f30e
+M29X21->(M30X11 M30X25 M30X24)
83f30e
+M29X22->(M30X22 M30X21 M30X20)
83f30e
+M29X23->(M30X18 M30X17 M30X16)
83f30e
+M29X24->(M30X14 M30X13 M30X12)
83f30e
+M29X25->(M30X25 M30X24 M30X23)
83f30e
+M30X11
83f30e
+M30X12
83f30e
+M30X13
83f30e
+M30X14
83f30e
+M30X15
83f30e
+M30X16
83f30e
+M30X17
83f30e
+M30X18
83f30e
+M30X19
83f30e
+M30X20
83f30e
+M30X21
83f30e
+M30X22
83f30e
+M30X23
83f30e
+M30X24
83f30e
+M30X25
83f30e
+xfail_output(glibc.rtld.dynamic_sort=1): M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M27X14>M28X18>M27X15>M28X13>M27X11>M28X23>M27X25>M28X14>M28X25>M27X23>M27X22>M28X24>M27X21>M27X13>M27X19>M27X17>M26X11>M26X23>M26X21>M26X22>M26X20>M26X16>M25X21>M17X22>M15X15>M20X14>M20X16>M18X18>M28X12>M27X24>M25X17>M27X20>M26X18>M26X17>M27X16>M26X19>M25X18>M26X24>M25X20>M24X17>M23X18>M25X13>M26X13>M17X23>M16X16>M26X12>M25X12>M26X15>M24X19>M25X23>M25X24>M25X25>M24X20>M25X19>M24X21>M23X17>M22X21>M24X14>M23X22>M24X24>M22X20>M24X13>M25X11>M24X12>M25X15>M23X15>M25X16>M24X22>M23X13>M24X18>M23X14>M22X22>M21X20>M24X25>M23X16>M22X25>M21X19>M22X14>M23X11>M22X15>M21X18>M22X19>M21X17>M20X17>M19X17>M21X24>M21X12>M20X22>M19X16>M18X25>M19X21>M19X20>M18X24>M20X12>M19X11>M23X20>M22X24>M22X16>M21X21>M25X14>M23X19>M23X24>M20X24>M19X12>M18X15>M17X14>M16X18>M14X25>M16X22>M16X20>M17X17>M22X12>M21X11>M20X15>M18X22>M19X24>M19X18>M18X21>M17X16>M17X18>M16X21>M15X20>M19X22>M18X20>M18X11>M17X19>M16X17>M15X21>M16X14>M16X13>M15X22>M14X20>M17X25>M16X19>M14X21>M13X24>M12X12>M16X24>M15X23>M14X16>M16X15>M15X25>M15X11>M15X12>M14X15>M13X14>M14X22>M13X20>M12X13>M11X11>M22X23>M21X15>M21X16>M20X21>M20X20>M18X17>M19X25>M18X23>M21X13>M15X17>M15X18>M18X19>M17X24>M16X12>M17X13>M20X25>M19X23>M15X19>M14X13>M13X18>M15X13>M17X12>M16X11>M18X13>M18X12>M14X11>M14X24>M13X19>M15X14>M17X20>M20X11>M20X13>M21X14>M15X24>M14X12>M13X22>M14X23>M13X23>M14X19>M17X15>M16X25>M17X11>M18X14>M19X19>M21X25>M13X12>M13X11>M14X18>M13X13>M12X11>M15X16>M14X14>M27X12>M17X21>M20X23>M22X13>M21X22>M24X16>M24X15>M26X25>M23X25>M26X14>M23X12>M22X18>M24X11>M16X23>M19X14>M19X13>M21X23>M22X17>M23X23>M23X21>M25X22>M18X16>M19X15>M20X18>M20X19>M22X11>M24X23>C156>C118>C143>C137>C147>C106>C168>C113>C163>C155>C105>C146>C187>A150>C139>C180>C164>C193>C157>A191>C158>B188>A159>C184>C121>C154>B171>A105>C131>C104>B104>C161>C111>B145>C160>B155>A163>C112>C142>B148>C133>B198>A198>A115>C114>B157>A156>C175>B144>A120>C173>B184>A174>C126>B107>A139>C194>B194>A194>C116>B116>C166>B160>B110>A110>C128>B128>A128>C179>B162>A154>C186>B187>A179>C124>B181>A101>C153>B158>A136>C135>C176>A192>B133>A133>C177>B177>A177>C185>C103>B141>A141>C183>A162>C192>C129>B179>C144>B124>B183>C127>B127>A127>B108>A112>B153>A153>C167>B167>A186>A122>C162>A144>B149>C174>B131>A185>C141>B106>A126>A167>C140>B122>A170>C198>B143>C117>C123>B123>A147>A106>C200>B169>C191>B175>A123>B118>A182>C132>B151>A145>A104>A109>C159>C150>B119>A119>A178>B164>B114>A164>C181>A102>C122>B134>A157>A116>C195>B191>B111>C172>B172>A118>B129>A129>C149>A107>C170>B197>A197>A173>B168>A132>C107>B165>A160>A131>C188>A168>B109>C178>A189>A148>C119>C190>C120>B166>B176>C108>B135>B139>A103>B178>A169>B132>C125>C138>B163>A111>B170>C110>A165>C151>C169>C199>A138>C182>A135>B101>B142>C101>C148>B193>B152>A158>A199>C136>B137>A161>B120>A108>A149>A125>B113>A184>C171>A134>A175>A124>B150>B161>B102>A146>A187>C130>B192>B200>A200>A142>A183>C102>B105>B156>A176>C165>B147>A137>A196>B190>A190>B125>C134>C189>B126>B186>A166>B136>B195>A195>B154>B138>B112>B173>A117>B159>B182>A181>A140>C145>B117>A152>A193>C197>B130>A172>A113>A151>B115>A143>B140>B185>B103>A121>A180>A130>A171>B199>C196>B146>B180>C115>B174>B121>A188>B196>B189>C152>C109>A155>A114>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}
83f30e
+output(glibc.rtld.dynamic_sort=2): M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>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>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}
83f30e
diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
83f30e
new file mode 100644
83f30e
index 0000000000000000..944ee740527d60fd
83f30e
--- /dev/null
83f30e
+++ b/scripts/dso-ordering-test.py
83f30e
@@ -0,0 +1,1144 @@
83f30e
+#!/usr/bin/python3
83f30e
+# Generate testcase files and Makefile fragments for DSO sorting test
83f30e
+# Copyright (C) 2021 Free Software Foundation, Inc.
83f30e
+# This file is part of the GNU C Library.
83f30e
+#
83f30e
+# The GNU C Library is free software; you can redistribute it and/or
83f30e
+# modify it under the terms of the GNU Lesser General Public
83f30e
+# License as published by the Free Software Foundation; either
83f30e
+# version 2.1 of the License, or (at your option) any later version.
83f30e
+#
83f30e
+# The GNU C Library is distributed in the hope that it will be useful,
83f30e
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
83f30e
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
83f30e
+# Lesser General Public License for more details.
83f30e
+#
83f30e
+# You should have received a copy of the GNU Lesser General Public
83f30e
+# License along with the GNU C Library; if not, see
83f30e
+# <http://www.gnu.org/licenses/>.
83f30e
+
83f30e
+"""Generate testcase files and Makefile fragments for DSO sorting test
83f30e
+
83f30e
+This script takes a small description string language, and generates
83f30e
+testcases for displaying the ELF dynamic linker's dependency sorting
83f30e
+behavior, allowing verification.
83f30e
+
83f30e
+Testcase descriptions are semicolon-separated description strings, and
83f30e
+this tool generates a testcase from the description, including main program,
83f30e
+associated modules, and Makefile fragments for including into elf/Makefile.
83f30e
+
83f30e
+This allows automation of what otherwise would be very laborous manual
83f30e
+construction of complex dependency cases, however it must be noted that this
83f30e
+is only a tool to speed up testcase construction, and thus the generation
83f30e
+features are largely mechanical in nature; inconsistencies or errors may occur
83f30e
+if the input description was itself erroneous or have unforeseen interactions.
83f30e
+
83f30e
+The format of the input test description files are:
83f30e
+
83f30e
+  # Each test description has a name, lines of description,
83f30e
+  # and an expected output specification.  Comments use '#'.
83f30e
+  testname1: <test-description-line>
83f30e
+  output: <expected-output-string>
83f30e
+
83f30e
+  # Tests can be marked to be XFAIL by using 'xfail_output' instead
83f30e
+  testname2: <test-description-line>
83f30e
+  xfail_output: <expected-output-string>
83f30e
+
83f30e
+  # A default set of GLIBC_TUNABLES tunables can be specified, for which
83f30e
+  # all following tests will run multiple times, once for each of the
83f30e
+  # GLIBC_TUNABLES=... strings set by the 'tunable_option' command.
83f30e
+  tunable_option: <glibc-tunable-string1>
83f30e
+  tunable_option: <glibc-tunable-string2>
83f30e
+
83f30e
+  # Test descriptions can use multiple lines, which will all be merged
83f30e
+  # together, so order is not important.
83f30e
+  testname3: <test-description-line>
83f30e
+  <test-description-line>
83f30e
+  <test-description-line>
83f30e
+  ...
83f30e
+  output: <expected-output-string>
83f30e
+
83f30e
+  # 'testname3' will be run and compared two times, for both
83f30e
+  # GLIBC_TUNABLES=<glibc-tunable-string1> and
83f30e
+  # GLIBC_TUNABLES=<glibc-tunable-string2>.  This can be cleared and reset by the
83f30e
+  # 'clear_tunables' command:
83f30e
+  clear_tunables
83f30e
+
83f30e
+  # Multiple expected outputs can also be specified, with an associated
83f30e
+  # tunable option in (), which multiple tests will be run with each
83f30e
+  # GLIBC_TUNABLES=... option tried.
83f30e
+  testname4:
83f30e
+  <test-description-line>
83f30e
+  ...
83f30e
+  output(<glibc-tunable-string1>): <expected-output-string-1>
83f30e
+  output(<glibc-tunable-string2>): <expected-output-string-2>
83f30e
+  # Individual tunable output cases can be XFAILed, though note that
83f30e
+  # this will have the effect of XFAILing the entire 'testname4' test
83f30e
+  # in the final top-level tests.sum summary.
83f30e
+  xfail_output(<glibc-tunable-string3>): <expected-output-string-3>
83f30e
+
83f30e
+  # When multiple outputs (with specific tunable strings) are specified,
83f30e
+  # these take priority over any active 'tunable_option' settings.
83f30e
+
83f30e
+  # When a test is meant to be placed under 'xtests' (not run under
83f30e
+  # "make check", but only when "make xtests" is used), the testcase name can be
83f30e
+  # declared using 'xtest(<test-name>)':
83f30e
+  ...
83f30e
+  xtest(test-too-big1): <test-description>
83f30e
+  output: <expected-output-string>
83f30e
+  ...
83f30e
+
83f30e
+  # Do note that under current elf/Makefile organization, for such a xtest case,
83f30e
+  # while the test execution is only run under 'make xtests', the associated
83f30e
+  # DSOs are always built even under 'make check'.
83f30e
+
83f30e
+On the description language used, an example description line string:
83f30e
+
83f30e
+  a->b!->[cdef];c=>g=>h;{+c;%c;-c}->a
83f30e
+
83f30e
+Each identifier represents a shared object module, currently sequences of
83f30e
+letters/digits are allowed, case-sensitive.
83f30e
+
83f30e
+All such shared objects have a constructor/destructor generated for them
83f30e
+that emits its name followed by a '>' for constructors, and '<' followed by
83f30e
+its name for destructors, e.g. if the name is 'obj1', then "obj1>" and "
83f30e
+is printed by its constructor/destructor respectively.
83f30e
+
83f30e
+The -> operator specifies a link time dependency, these can be chained for
83f30e
+convenience (e.g. a->b->c->d).
83f30e
+
83f30e
+The => operator creates a call-reference, e.g. for a=>b, an fn_a() function
83f30e
+is created inside module 'a', which calls fn_b() in module 'b'.
83f30e
+These module functions emit 'name()' output in nested form,
83f30e
+e.g. a=>b emits 'a(b())'
83f30e
+
83f30e
+For single character object names, square brackets [] in the description
83f30e
+allows specifying multiple objects; e.g. a->[bcd]->e is equivalent to
83f30e
+ a->b->e;a->c->e;a->d->e
83f30e
+
83f30e
+The () parenthesis construct with space separated names is also allowed for
83f30e
+specifying objects.  For names with integer suffixes a range can also be used,
83f30e
+e.g. (foo1 bar2-5), specifies DSOs foo1, bar2, bar2, bar3, bar4, bar5.
83f30e
+
83f30e
+A {} construct specifies the main test program, and its link dependencies
83f30e
+are also specified using ->.  Inside {}, a few ;-separated constructs are
83f30e
+allowed:
83f30e
+         +a   Loads module a using dlopen(RTLD_LAZY|RTLD_GLOBAL)
83f30e
+         ^a   Loads module a using dlopen(RTLD_LAZY)
83f30e
+         %a   Use dlsym() to load and call fn_a()
83f30e
+         @a   Calls fn_a() directly.
83f30e
+         -a   Unloads module a using dlclose()
83f30e
+
83f30e
+The generated main program outputs '{' '}' with all output from above
83f30e
+constructs in between.  The other output before/after {} are the ordered
83f30e
+constructor/destructor output.
83f30e
+
83f30e
+If no {} construct is present, a default empty main program is linked
83f30e
+against all objects which have no dependency linked to it. e.g. for
83f30e
+'[ab]->c;d->e', the default main program is equivalent to '{}->[abd]'
83f30e
+
83f30e
+Sometimes for very complex or large testcases, besides specifying a
83f30e
+few explicit dependencies from main{}, the above default dependency
83f30e
+behavior is still useful to automatically have, but is turned off
83f30e
+upon specifying a single explicit {}->dso_name.
83f30e
+In this case, add {}->* to explicitly add this generation behavior:
83f30e
+
83f30e
+   # Main program links to 'foo', and all other objects which have no
83f30e
+   # dependency linked to it.
83f30e
+   {}->foo,{}->*
83f30e
+
83f30e
+Note that '*' works not only on main{}, but can be used as the
83f30e
+dependency target of any object.  Note that it only works as a target,
83f30e
+not a dependency source.
83f30e
+
83f30e
+The '!' operator after object names turns on permutation of its
83f30e
+dependencies, e.g. while a->[bcd] only generates one set of objects,
83f30e
+with 'a.so' built with a link line of "b.so c.so d.so", for a!->[bcd]
83f30e
+permutations of a's dependencies creates multiple testcases with
83f30e
+different link line orders: "b.so c.so d.so", "c.so b.so d.so",
83f30e
+"b.so d.so c.so", etc.  Note that for a <test-name> specified on
83f30e
+the script command-line, multiple <test-name_1>, <test-name_2>, etc.
83f30e
+tests will be generated (e.g. for a!->[bc]!->[de], eight tests with
83f30e
+different link orders for a, b, and c will be generated)
83f30e
+
83f30e
+It is possible to specify the ELF soname field for an object or the
83f30e
+main program:
83f30e
+   # DSO 'a' will be linked with the appropriate -Wl,-soname=x setting
83f30e
+   a->b->c;soname(a)=x
83f30e
+   # The the main program can also have a soname specified
83f30e
+   soname({})=y
83f30e
+
83f30e
+This can be used to test how ld.so behaves when objects and/or the
83f30e
+main program have such a field set.
83f30e
+
83f30e
+
83f30e
+Strings Output by Generated Testcase Programs
83f30e
+
83f30e
+The text output produced by a generated testcase consists of three main
83f30e
+parts:
83f30e
+  1. The constructors' output
83f30e
+  2. Output from the main program
83f30e
+  3. Destructors' output
83f30e
+
83f30e
+To see by example, a simple test description "a->b->c" generates a testcase
83f30e
+that when run, outputs: "c>b>a>{}
83f30e
+
83f30e
+Each generated DSO constructor prints its name followed by a '>' character,
83f30e
+and the "c>b>a" part above is the full constructor output by all DSOs, the
83f30e
+order indicating that DSO 'c', which does not depend on any other DSO, has
83f30e
+its constructor run first, followed by 'b' and then 'a'.
83f30e
+
83f30e
+Destructor output for each DSO is a '<' character followed by its name,
83f30e
+reflecting its reverse nature of constructors.  In the above example, the
83f30e
+destructor output part is "
83f30e
+
83f30e
+The middle "{}" part is the main program.  In this simple example, nothing
83f30e
+was specified for the main program, so by default it is implicitly linked
83f30e
+to the DSO 'a' (with no other DSOs depending on it) and only prints the
83f30e
+brackets {} with no actions inside.
83f30e
+
83f30e
+To see an example with actions inside the main program, lets see an example
83f30e
+description: c->g=>h;{+c;%c;-c}->a->h
83f30e
+
83f30e
+This produces a testcase, that when executed outputs:
83f30e
+             h>a>{+c[g>c>];%c();-c[
83f30e
+
83f30e
+The constructor and destructor parts display the a->h dependency as expected.
83f30e
+Inside the main program, the "+c" action triggers a dlopen() of DSO 'c',
83f30e
+causing another chain of constructors "g>c>" to be triggered.  Here it is
83f30e
+displayed inside [] brackets for each dlopen call.  The same is done for "-c",
83f30e
+a dlclose() of 'c'.
83f30e
+
83f30e
+The "%c" output is due to calling to fn_c() inside DSO 'c', this comprises
83f30e
+of two parts: the '%' character is printed by the caller, here it is the main
83f30e
+program.  The 'c' character is printed from inside fn_c().  The '%' character
83f30e
+indicates that this is called by a dlsym() of "fn_c".  A '@' character would
83f30e
+mean a direct call (with a symbol reference).  These can all be controlled
83f30e
+by the main test program constructs documented earlier.
83f30e
+
83f30e
+The output strings described here is the exact same form placed in
83f30e
+test description files' "output: <expected output>" line.
83f30e
+"""
83f30e
+
83f30e
+import sys
83f30e
+import re
83f30e
+import os
83f30e
+import subprocess
83f30e
+import argparse
83f30e
+from collections import OrderedDict
83f30e
+import itertools
83f30e
+
83f30e
+# BUILD_GCC is only used under the --build option,
83f30e
+# which builds the generated testcase, including DSOs using BUILD_GCC.
83f30e
+# Mainly for testing purposes, especially debugging of this script,
83f30e
+# and can be changed here to another toolchain path if needed.
83f30e
+build_gcc = "gcc"
83f30e
+
83f30e
+def get_parser():
83f30e
+    parser = argparse.ArgumentParser("")
83f30e
+    parser.add_argument("description",
83f30e
+                         help="Description string of DSO dependency test to be "
83f30e
+                         "generated (see script source for documentation of "
83f30e
+                         "description language), either specified here as "
83f30e
+                         "command line argument, or by input file using "
83f30e
+                         "-f/--description-file option",
83f30e
+                         nargs="?", default="")
83f30e
+    parser.add_argument("test_name",
83f30e
+                        help="Identifier for testcase being generated",
83f30e
+                        nargs="?", default="")
83f30e
+    parser.add_argument("--objpfx",
83f30e
+                        help="Path to place generated files, defaults to "
83f30e
+                        "current directory if none specified",
83f30e
+                        nargs="?", default="./")
83f30e
+    parser.add_argument("-m", "--output-makefile",
83f30e
+                        help="File to write Makefile fragment to, defaults to "
83f30e
+                        "stdout when option not present",
83f30e
+                        nargs="?", default="")
83f30e
+    parser.add_argument("-f", "--description-file",
83f30e
+                        help="Input file containing testcase descriptions",
83f30e
+                        nargs="?", default="")
83f30e
+    parser.add_argument("--build", help="After C testcase generated, build it "
83f30e
+                        "using gcc (for manual testing purposes)",
83f30e
+                        action="store_true")
83f30e
+    parser.add_argument("--debug-output",
83f30e
+                        help="Prints some internal data "
83f30e
+                        "structures; used for debugging of this script",
83f30e
+                        action="store_true")
83f30e
+    return parser
83f30e
+
83f30e
+# Main script starts here.
83f30e
+cmdlineargs = get_parser().parse_args()
83f30e
+test_name = cmdlineargs.test_name
83f30e
+description = cmdlineargs.description
83f30e
+objpfx = cmdlineargs.objpfx
83f30e
+description_file = cmdlineargs.description_file
83f30e
+output_makefile = cmdlineargs.output_makefile
83f30e
+makefile = ""
83f30e
+default_tunable_options = []
83f30e
+
83f30e
+current_input_lineno = 0
83f30e
+def error(msg):
83f30e
+    global current_input_lineno
83f30e
+    print("Error: %s%s" % ((("Line %d, " % current_input_lineno)
83f30e
+                            if current_input_lineno != 0 else ""),
83f30e
+                           msg))
83f30e
+    exit(1)
83f30e
+
83f30e
+if(test_name or description) and description_file:
83f30e
+    error("both command-line testcase and input file specified")
83f30e
+if test_name and not description:
83f30e
+    error("command-line testcase name without description string")
83f30e
+
83f30e
+# Main class type describing a testcase.
83f30e
+class TestDescr:
83f30e
+    def __init__(self):
83f30e
+        self.objs = []              # list of all DSO objects
83f30e
+        self.deps = OrderedDict()   # map of DSO object -> list of dependencies
83f30e
+
83f30e
+        # map of DSO object -> list of call refs
83f30e
+        self.callrefs = OrderedDict()
83f30e
+
83f30e
+        # map of DSO object -> list of permutations of dependencies
83f30e
+        self.dep_permutations = OrderedDict()
83f30e
+
83f30e
+        # map of DSO object -> SONAME of object (if one is specified)
83f30e
+        self.soname_map = OrderedDict()
83f30e
+
83f30e
+        # list of main program operations
83f30e
+        self.main_program = []
83f30e
+        # set if default dependencies added to main
83f30e
+        self.main_program_default_deps = True
83f30e
+
83f30e
+        self.test_name = ""                   # name of testcase
83f30e
+        self.expected_outputs = OrderedDict() # expected outputs of testcase
83f30e
+        self.xfail = False                    # set if this is a XFAIL testcase
83f30e
+        self.xtest = False                    # set if this is put under 'xtests'
83f30e
+
83f30e
+    # Add 'object -> [object, object, ...]' relations to CURR_MAP
83f30e
+    def __add_deps_internal(self, src_objs, dst_objs, curr_map):
83f30e
+        for src in src_objs:
83f30e
+            for dst in dst_objs:
83f30e
+                if not src in curr_map:
83f30e
+                    curr_map[src] = []
83f30e
+                if not dst in curr_map[src]:
83f30e
+                    curr_map[src].append(dst)
83f30e
+    def add_deps(self, src_objs, dst_objs):
83f30e
+        self.__add_deps_internal(src_objs, dst_objs, self.deps)
83f30e
+    def add_callrefs(self, src_objs, dst_objs):
83f30e
+        self.__add_deps_internal(src_objs, dst_objs, self.callrefs)
83f30e
+
83f30e
+# Process commands inside the {} construct.
83f30e
+# Note that throughout this script, the main program object is represented
83f30e
+# by the '#' string.
83f30e
+def process_main_program(test_descr, mainprog_str):
83f30e
+    if mainprog_str:
83f30e
+        test_descr.main_program = mainprog_str.split(';')
83f30e
+    for s in test_descr.main_program:
83f30e
+        m = re.match(r"^([+\-%^@])([0-9a-zA-Z]+)$", s)
83f30e
+        if not m:
83f30e
+            error("'%s' is not recognized main program operation" % (s))
83f30e
+        opr = m.group(1)
83f30e
+        obj = m.group(2)
83f30e
+        if not obj in test_descr.objs:
83f30e
+            test_descr.objs.append(obj)
83f30e
+        if opr == '%' or opr == '@':
83f30e
+            test_descr.add_callrefs(['#'], [obj])
83f30e
+    # We have a main program specified, turn this off
83f30e
+    test_descr.main_program_default_deps = False
83f30e
+
83f30e
+# For(a1 a2 b1-12) object set descriptions, expand into an object list
83f30e
+def expand_object_set_string(descr_str):
83f30e
+    obj_list = []
83f30e
+    descr_list = descr_str.split()
83f30e
+    for descr in descr_list:
83f30e
+        m = re.match(r"^([a-zA-Z][0-9a-zA-Z]*)(-[0-9]+)?$", descr)
83f30e
+        if not m:
83f30e
+            error("'%s' is not a valid object set description" % (descr))
83f30e
+        obj = m.group(1)
83f30e
+        idx_end = m.group(2)
83f30e
+        if not idx_end:
83f30e
+            if not obj in obj_list:
83f30e
+                obj_list.append(obj)
83f30e
+        else:
83f30e
+            idx_end = int(idx_end[1:])
83f30e
+            m = re.match(r"^([0-9a-zA-Z][a-zA-Z]*)([0-9]+)$", obj)
83f30e
+            if not m:
83f30e
+                error("object description '%s' is malformed" % (obj))
83f30e
+            obj_name = m.group(1)
83f30e
+            idx_start = int(m.group (2))
83f30e
+            if idx_start > idx_end:
83f30e
+                error("index range %s-%s invalid" % (idx_start, idx_end))
83f30e
+            for i in range(idx_start, idx_end + 1):
83f30e
+                o = obj_name + str(i)
83f30e
+                if not o in obj_list:
83f30e
+                    obj_list.append(o)
83f30e
+    return obj_list
83f30e
+
83f30e
+# Lexer for tokens
83f30e
+tokenspec = [ ("SONAME",   r"soname\(([0-9a-zA-Z{}]+)\)=([0-9a-zA-Z]+)"),
83f30e
+              ("OBJ",      r"([0-9a-zA-Z]+)"),
83f30e
+              ("DEP",      r"->"),
83f30e
+              ("CALLREF",  r"=>"),
83f30e
+              ("OBJSET",   r"\[([0-9a-zA-Z]+)\]"),
83f30e
+              ("OBJSET2",  r"\(([0-9a-zA-Z \-]+)\)"),
83f30e
+              ("OBJSET3",  r"\*"),
83f30e
+              ("PROG",     r"{([0-9a-zA-Z;+^\-%@]*)}"),
83f30e
+              ("PERMUTE",  r"!"),
83f30e
+              ("SEMICOL",  r";"),
83f30e
+              ("ERROR",    r".") ]
83f30e
+tok_re = '|'.join('(?P<%s>%s)' % pair for pair in tokenspec)
83f30e
+
83f30e
+# Main line parser of description language
83f30e
+def parse_description_string(t, descr_str):
83f30e
+    # State used when parsing dependencies
83f30e
+    curr_objs = []
83f30e
+    in_dep = False
83f30e
+    in_callref = False
83f30e
+    def clear_dep_state():
83f30e
+        nonlocal in_dep, in_callref
83f30e
+        in_dep = in_callref = False
83f30e
+
83f30e
+    for m in re.finditer(tok_re, descr_str):
83f30e
+        kind = m.lastgroup
83f30e
+        value = m.group()
83f30e
+        if kind == "SONAME":
83f30e
+            s = re.match(r"soname\(([0-9a-zA-Z{}]+)\)=([0-9a-zA-Z]+)", value)
83f30e
+            obj = s.group(1)
83f30e
+            val = s.group(2)
83f30e
+            if obj == "{}":
83f30e
+                if '#' in t.soname_map:
83f30e
+                    error("soname of main program already set")
83f30e
+                # Adjust to internal name
83f30e
+                obj = '#'
83f30e
+            else:
83f30e
+                if re.match(r"[{}]", obj):
83f30e
+                    error("invalid object name '%s'" % (obj))
83f30e
+                if not obj in t.objs:
83f30e
+                    error("'%s' is not name of already defined object" % (obj))
83f30e
+                if obj in t.soname_map:
83f30e
+                    error("'%s' already has soname of '%s' set"
83f30e
+                          % (obj, t.soname_map[obj]))
83f30e
+            t.soname_map[obj] = val
83f30e
+
83f30e
+        elif kind == "OBJ":
83f30e
+            if in_dep:
83f30e
+                t.add_deps(curr_objs, [value])
83f30e
+            elif in_callref:
83f30e
+                t.add_callrefs(curr_objs, [value])
83f30e
+            clear_dep_state()
83f30e
+            curr_objs = [value]
83f30e
+            if not value in t.objs:
83f30e
+                t.objs.append(value)
83f30e
+
83f30e
+        elif kind == "OBJSET":
83f30e
+            objset = value[1:len(value)-1]
83f30e
+            if in_dep:
83f30e
+                t.add_deps(curr_objs, list (objset))
83f30e
+            elif in_callref:
83f30e
+                t.add_callrefs(curr_objs, list (objset))
83f30e
+            clear_dep_state()
83f30e
+            curr_objs = list(objset)
83f30e
+            for o in list(objset):
83f30e
+                if not o in t.objs:
83f30e
+                    t.objs.append(o)
83f30e
+
83f30e
+        elif kind == "OBJSET2":
83f30e
+            descr_str = value[1:len(value)-1]
83f30e
+            descr_str.strip()
83f30e
+            objs = expand_object_set_string(descr_str)
83f30e
+            if not objs:
83f30e
+                error("empty object set '%s'" % (value))
83f30e
+            if in_dep:
83f30e
+                t.add_deps(curr_objs, objs)
83f30e
+            elif in_callref:
83f30e
+                t.add_callrefs(curr_objs, objs)
83f30e
+            clear_dep_state()
83f30e
+            curr_objs = objs
83f30e
+            for o in objs:
83f30e
+                if not o in t.objs:
83f30e
+                    t.objs.append(o)
83f30e
+
83f30e
+        elif kind == "OBJSET3":
83f30e
+            if in_dep:
83f30e
+                t.add_deps(curr_objs, ['*'])
83f30e
+            elif in_callref:
83f30e
+                t.add_callrefs(curr_objs, ['*'])
83f30e
+            else:
83f30e
+                error("non-dependence target set '*' can only be used "
83f30e
+                      "as target of ->/=> operations")
83f30e
+            clear_dep_state()
83f30e
+            curr_objs = ['*']
83f30e
+
83f30e
+        elif kind == "PERMUTE":
83f30e
+            if in_dep or in_callref:
83f30e
+                error("syntax error, permute operation invalid here")
83f30e
+            if not curr_objs:
83f30e
+                error("syntax error, no objects to permute here")
83f30e
+
83f30e
+            for obj in curr_objs:
83f30e
+                if not obj in t.dep_permutations:
83f30e
+                    # Signal this object has permuted dependencies
83f30e
+                    t.dep_permutations[obj] = []
83f30e
+
83f30e
+        elif kind == "PROG":
83f30e
+            if t.main_program:
83f30e
+                error("cannot have more than one main program")
83f30e
+            if in_dep:
83f30e
+                error("objects cannot have dependency on main program")
83f30e
+            if in_callref:
83f30e
+                # TODO: A DSO can resolve to a symbol in the main binary,
83f30e
+                # which we syntactically allow here, but haven't yet
83f30e
+                # implemented.
83f30e
+                t.add_callrefs(curr_objs, ["#"])
83f30e
+            process_main_program(t, value[1:len(value)-1])
83f30e
+            clear_dep_state()
83f30e
+            curr_objs = ["#"]
83f30e
+
83f30e
+        elif kind == "DEP":
83f30e
+            if in_dep or in_callref:
83f30e
+                error("syntax error, multiple contiguous ->,=> operations")
83f30e
+            if '*' in curr_objs:
83f30e
+                error("non-dependence target set '*' can only be used "
83f30e
+                      "as target of ->/=> operations")
83f30e
+            in_dep = True
83f30e
+
83f30e
+        elif kind == "CALLREF":
83f30e
+            if in_dep or in_callref:
83f30e
+                error("syntax error, multiple contiguous ->,=> operations")
83f30e
+            if '*' in curr_objs:
83f30e
+                error("non-dependence target set '*' can only be used "
83f30e
+                      "as target of ->/=> operations")
83f30e
+            in_callref = True
83f30e
+
83f30e
+        elif kind == "SEMICOL":
83f30e
+            curr_objs = []
83f30e
+            clear_dep_state()
83f30e
+
83f30e
+        else:
83f30e
+            error("unknown token '%s'" % (value))
83f30e
+    return t
83f30e
+
83f30e
+# Main routine to process each testcase description
83f30e
+def process_testcase(t):
83f30e
+    global objpfx
83f30e
+    assert t.test_name
83f30e
+
83f30e
+    base_test_name = t.test_name
83f30e
+    test_subdir = base_test_name + "-dir"
83f30e
+    testpfx = objpfx + test_subdir + "/"
83f30e
+
83f30e
+    if not os.path.exists(testpfx):
83f30e
+        os.mkdir(testpfx)
83f30e
+
83f30e
+    def find_objs_not_depended_on(t):
83f30e
+        objs_not_depended_on = []
83f30e
+        for obj in t.objs:
83f30e
+            skip = False
83f30e
+            for r in t.deps.items():
83f30e
+                if obj in r[1]:
83f30e
+                    skip = True
83f30e
+                    break
83f30e
+            if not skip:
83f30e
+                objs_not_depended_on.append(obj)
83f30e
+        return objs_not_depended_on
83f30e
+
83f30e
+    non_dep_tgt_objs = find_objs_not_depended_on(t)
83f30e
+    for obj in t.objs:
83f30e
+        if obj in t.deps:
83f30e
+            deps = t.deps[obj]
83f30e
+            if '*' in deps:
83f30e
+                t.deps[obj].remove('*')
83f30e
+                t.add_deps([obj], non_dep_tgt_objs)
83f30e
+        if obj in t.callrefs:
83f30e
+            deps = t.callrefs[obj]
83f30e
+            if '*' in deps:
83f30e
+                t.deps[obj].remove('*')
83f30e
+                t.add_callrefs([obj], non_dep_tgt_objs)
83f30e
+    if "#" in t.deps:
83f30e
+        deps = t.deps["#"]
83f30e
+        if '*' in deps:
83f30e
+            t.deps["#"].remove('*')
83f30e
+            t.add_deps(["#"], non_dep_tgt_objs)
83f30e
+
83f30e
+    # If no main program was specified in dependency description, make a
83f30e
+    # default main program with deps pointing to all DSOs which are not
83f30e
+    # depended by another DSO.
83f30e
+    if t.main_program_default_deps:
83f30e
+        main_deps = non_dep_tgt_objs
83f30e
+        if not main_deps:
83f30e
+            error("no objects for default main program to point "
83f30e
+                  "dependency to(all objects strongly connected?)")
83f30e
+        t.add_deps(["#"], main_deps)
83f30e
+
83f30e
+    # Some debug output
83f30e
+    if cmdlineargs.debug_output:
83f30e
+        print("Testcase: %s" % (t.test_name))
83f30e
+        print("All objects: %s" % (t.objs))
83f30e
+        print("--- Static link dependencies ---")
83f30e
+        for r in t.deps.items():
83f30e
+            print("%s -> %s" % (r[0], r[1]))
83f30e
+        print("--- Objects whose dependencies are to be permuted ---")
83f30e
+        for r in t.dep_permutations.items():
83f30e
+            print("%s" % (r[0]))
83f30e
+        print("--- Call reference dependencies ---")
83f30e
+        for r in t.callrefs.items():
83f30e
+            print("%s => %s" % (r[0], r[1]))
83f30e
+        print("--- main program ---")
83f30e
+        print(t.main_program)
83f30e
+
83f30e
+    # Main testcase generation routine, does Makefile fragment generation,
83f30e
+    # testcase source generation, and if --build specified builds testcase.
83f30e
+    def generate_testcase(test_descr, test_suffix):
83f30e
+
83f30e
+        test_name = test_descr.test_name + test_suffix
83f30e
+
83f30e
+        # Print out needed Makefile fragments for use in glibc/elf/Makefile.
83f30e
+        module_names = ""
83f30e
+        for o in test_descr.objs:
83f30e
+            module_names += " " + test_subdir + "/" + test_name + "-" + o
83f30e
+        makefile.write("modules-names +=%s\n" % (module_names))
83f30e
+
83f30e
+        # Depth-first traversal, executing FN(OBJ) in post-order
83f30e
+        def dfs(t, fn):
83f30e
+            def dfs_rec(obj, fn, obj_visited):
83f30e
+                if obj in obj_visited:
83f30e
+                    return
83f30e
+                obj_visited[obj] = True
83f30e
+                if obj in t.deps:
83f30e
+                    for dep in t.deps[obj]:
83f30e
+                        dfs_rec(dep, fn, obj_visited)
83f30e
+                fn(obj)
83f30e
+
83f30e
+            obj_visited = {}
83f30e
+            for obj in t.objs:
83f30e
+                dfs_rec(obj, fn, obj_visited)
83f30e
+
83f30e
+        # Generate link dependencies for all DSOs, done in a DFS fashion.
83f30e
+        # Usually this doesn't need to be this complex, just listing the direct
83f30e
+        # dependencies is enough.  However to support creating circular
83f30e
+        # dependency situations, traversing it by DFS and tracking processing
83f30e
+        # status is the natural way to do it.
83f30e
+        obj_processed = {}
83f30e
+        fake_created = {}
83f30e
+        def gen_link_deps(obj):
83f30e
+            if obj in test_descr.deps:
83f30e
+                dso = test_subdir + "/" + test_name + "-" + obj + ".so"
83f30e
+                dependencies = ""
83f30e
+                for dep in test_descr.deps[obj]:
83f30e
+                    if dep in obj_processed:
83f30e
+                        depstr = (" $(objpfx)" + test_subdir + "/"
83f30e
+                                  + test_name + "-" + dep + ".so")
83f30e
+                    else:
83f30e
+                        # A circular dependency is satisfied by making a
83f30e
+                        # fake DSO tagged with the correct SONAME
83f30e
+                        depstr = (" $(objpfx)" + test_subdir + "/"
83f30e
+                                  + test_name + "-" + dep + ".FAKE.so")
83f30e
+                        # Create empty C file and Makefile fragments for fake
83f30e
+                        # object.  This only needs to be done at most once for
83f30e
+                        # an object name.
83f30e
+                        if not dep in fake_created:
83f30e
+                            f = open(testpfx + test_name + "-" + dep
83f30e
+                                     + ".FAKE.c", "w")
83f30e
+                            f.write(" \n")
83f30e
+                            f.close()
83f30e
+                            # Generate rule to create fake object
83f30e
+                            makefile.write \
83f30e
+                                ("LDFLAGS-%s = -Wl,--no-as-needed "
83f30e
+                                 "-Wl,-soname=%s\n"
83f30e
+                                 % (test_name + "-" + dep + ".FAKE.so",
83f30e
+                                    ("$(objpfx)" + test_subdir + "/"
83f30e
+                                     + test_name + "-" + dep + ".so")))
83f30e
+                            makefile.write \
83f30e
+                                ("modules-names += %s\n"
83f30e
+                                 % (test_subdir + "/"
83f30e
+                                    + test_name + "-" + dep + ".FAKE"))
83f30e
+                            fake_created[dep] = True
83f30e
+                    dependencies += depstr
83f30e
+                makefile.write("$(objpfx)%s:%s\n" % (dso, dependencies))
83f30e
+            # Mark obj as processed
83f30e
+            obj_processed[obj] = True
83f30e
+
83f30e
+        dfs(test_descr, gen_link_deps)
83f30e
+
83f30e
+        # Print LDFLAGS-* and *-no-z-defs
83f30e
+        for o in test_descr.objs:
83f30e
+            dso = test_name + "-" + o + ".so"
83f30e
+            ldflags = "-Wl,--no-as-needed"
83f30e
+            if o in test_descr.soname_map:
83f30e
+                soname = ("$(objpfx)" + test_subdir + "/"
83f30e
+                          + test_name + "-"
83f30e
+                          + test_descr.soname_map[o] + ".so")
83f30e
+                ldflags += (" -Wl,-soname=" + soname)
83f30e
+            makefile.write("LDFLAGS-%s = %s\n" % (dso, ldflags))
83f30e
+            if o in test_descr.callrefs:
83f30e
+                makefile.write("%s-no-z-defs = yes\n" % (dso))
83f30e
+
83f30e
+        # Print dependencies for main test program.
83f30e
+        depstr = ""
83f30e
+        if '#' in test_descr.deps:
83f30e
+            for o in test_descr.deps['#']:
83f30e
+                depstr += (" $(objpfx)" + test_subdir + "/"
83f30e
+                           + test_name + "-" + o + ".so")
83f30e
+        makefile.write("$(objpfx)%s/%s:%s\n" % (test_subdir, test_name, depstr))
83f30e
+        ldflags = "-Wl,--no-as-needed"
83f30e
+        if '#' in test_descr.soname_map:
83f30e
+            soname = ("$(objpfx)" + test_subdir + "/"
83f30e
+                      + test_name + "-"
83f30e
+                      + test_descr.soname_map['#'] + ".so")
83f30e
+            ldflags += (" -Wl,-soname=" + soname)
83f30e
+        makefile.write("LDFLAGS-%s = %s\n" % (test_name, ldflags))
83f30e
+
83f30e
+        not_depended_objs = find_objs_not_depended_on(test_descr)
83f30e
+        if not_depended_objs:
83f30e
+            depstr = ""
83f30e
+            for dep in not_depended_objs:
83f30e
+                depstr += (" $(objpfx)" + test_subdir + "/"
83f30e
+                           + test_name + "-" + dep + ".so")
83f30e
+            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
83f30e
+
83f30e
+        # Add main executable to test-srcs
83f30e
+        makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))
83f30e
+        # Add dependency on main executable of test
83f30e
+        makefile.write("$(objpfx)%s.out: $(objpfx)%s/%s\n"
83f30e
+                        % (base_test_name, test_subdir, test_name))
83f30e
+
83f30e
+        for r in test_descr.expected_outputs.items():
83f30e
+            tunable_options = []
83f30e
+            specific_tunable = r[0]
83f30e
+            xfail = r[1][1]
83f30e
+            if specific_tunable != "":
83f30e
+                tunable_options = [specific_tunable]
83f30e
+            else:
83f30e
+                tunable_options = default_tunable_options
83f30e
+                if not tunable_options:
83f30e
+                    tunable_options = [""]
83f30e
+
83f30e
+            for tunable in tunable_options:
83f30e
+                tunable_env = ""
83f30e
+                tunable_sfx = ""
83f30e
+                exp_tunable_sfx = ""
83f30e
+                if tunable:
83f30e
+                    tunable_env = "GLIBC_TUNABLES=%s " % tunable
83f30e
+                    tunable_sfx = "-" + tunable.replace("=","_")
83f30e
+                if specific_tunable:
83f30e
+                    tunable_sfx = "-" + specific_tunable.replace("=","_")
83f30e
+                    exp_tunable_sfx = tunable_sfx
83f30e
+                tunable_descr = ("(%s)" % tunable_env.strip()
83f30e
+                                 if tunable_env else "")
83f30e
+                # Write out fragment of shell script for this single test.
83f30e
+                test_descr.sh.write \
83f30e
+                    ("%s${test_wrapper_env} ${run_program_env} \\\n"
83f30e
+                     "${common_objpfx}support/test-run-command \\\n"
83f30e
+                     "${common_objpfx}elf/ld.so \\\n"
83f30e
+                     "--library-path ${common_objpfx}elf/%s:"
83f30e
+                     "${common_objpfx}elf:${common_objpfx}.:"
83f30e
+                     "${common_objpfx}dlfcn \\\n"
83f30e
+                     "${common_objpfx}elf/%s/%s > \\\n"
83f30e
+                     "  ${common_objpfx}elf/%s/%s%s.output\n"
83f30e
+                     % (tunable_env ,test_subdir,
83f30e
+                        test_subdir, test_name, test_subdir, test_name,
83f30e
+                        tunable_sfx))
83f30e
+                # Generate a run of each test and compare with expected out
83f30e
+                test_descr.sh.write \
83f30e
+                    ("if [ $? -ne 0 ]; then\n"
83f30e
+                     "  echo '%sFAIL: %s%s execution test'\n"
83f30e
+                     "  something_failed=true\n"
83f30e
+                     "else\n"
83f30e
+                     "  diff -wu ${common_objpfx}elf/%s/%s%s.output \\\n"
83f30e
+                     "           ${common_objpfx}elf/%s/%s%s.exp\n"
83f30e
+                     "  if [ $? -ne 0 ]; then\n"
83f30e
+                     "    echo '%sFAIL: %s%s expected output comparison'\n"
83f30e
+                     "    something_failed=true\n"
83f30e
+                     "  fi\n"
83f30e
+                     "fi\n"
83f30e
+                     % (("X" if xfail else ""), test_name, tunable_descr,
83f30e
+                        test_subdir, test_name, tunable_sfx,
83f30e
+                        test_subdir, base_test_name, exp_tunable_sfx,
83f30e
+                        ("X" if xfail else ""), test_name, tunable_descr))
83f30e
+
83f30e
+        # Generate C files according to dependency and calling relations from
83f30e
+        # description string.
83f30e
+        for obj in test_descr.objs:
83f30e
+            src_name = test_name + "-" + obj + ".c"
83f30e
+            f = open(testpfx + src_name, "w")
83f30e
+            if obj in test_descr.callrefs:
83f30e
+                called_objs = test_descr.callrefs[obj]
83f30e
+                for callee in called_objs:
83f30e
+                    f.write("extern void fn_%s (void);\n" % (callee))
83f30e
+            if len(obj) == 1:
83f30e
+                f.write("extern int putchar(int);\n")
83f30e
+                f.write("static void __attribute__((constructor)) " +
83f30e
+                         "init(void){putchar('%s');putchar('>');}\n" % (obj))
83f30e
+                f.write("static void __attribute__((destructor)) " +
83f30e
+                         "fini(void){putchar('<');putchar('%s');}\n" % (obj))
83f30e
+            else:
83f30e
+                f.write('extern int printf(const char *, ...);\n')
83f30e
+                f.write('static void __attribute__((constructor)) ' +
83f30e
+                         'init(void){printf("%s>");}\n' % (obj))
83f30e
+                f.write('static void __attribute__((destructor)) ' +
83f30e
+                         'fini(void){printf("<%s");}\n' % (obj))
83f30e
+            if obj in test_descr.callrefs:
83f30e
+                called_objs = test_descr.callrefs[obj]
83f30e
+                if len(obj) != 1:
83f30e
+                    f.write("extern int putchar(int);\n")
83f30e
+                f.write("void fn_%s (void) {\n" % (obj))
83f30e
+                if len(obj) == 1:
83f30e
+                    f.write("  putchar ('%s');\n" % (obj));
83f30e
+                    f.write("  putchar ('(');\n");
83f30e
+                else:
83f30e
+                    f.write('  printf ("%s(");\n' % (obj));
83f30e
+                for callee in called_objs:
83f30e
+                    f.write("  fn_%s ();\n" % (callee))
83f30e
+                f.write("  putchar (')');\n");
83f30e
+                f.write("}\n")
83f30e
+            else:
83f30e
+                for callref in test_descr.callrefs.items():
83f30e
+                    if obj in callref[1]:
83f30e
+                        if len(obj) == 1:
83f30e
+                            # We need to declare printf here in this case.
83f30e
+                            f.write('extern int printf(const char *, ...);\n')
83f30e
+                        f.write("void fn_%s (void) {\n" % (obj))
83f30e
+                        f.write('  printf ("%s()");\n' % (obj))
83f30e
+                        f.write("}\n")
83f30e
+                        break
83f30e
+            f.close()
83f30e
+
83f30e
+        # Open C file for writing main program
83f30e
+        f = open(testpfx + test_name + ".c", "w")
83f30e
+
83f30e
+        # if there are some operations in main(), it means we need -ldl
83f30e
+        f.write("#include <stdio.h>\n")
83f30e
+        f.write("#include <stdlib.h>\n")
83f30e
+        f.write("#include <dlfcn.h>\n")
83f30e
+        for s in test_descr.main_program:
83f30e
+            if s[0] == '@':
83f30e
+                f.write("extern void fn_%s (void);\n" % (s[1:]));
83f30e
+        f.write("int main (void) {\n")
83f30e
+        f.write("  putchar('{');\n")
83f30e
+
83f30e
+        # Helper routine for generating sanity checking code.
83f30e
+        def put_fail_check(fail_cond, action_desc):
83f30e
+            f.write('  if (%s) { printf ("\\n%s failed: %%s\\n", '
83f30e
+                     'dlerror()); exit (1);}\n' % (fail_cond, action_desc))
83f30e
+        i = 0
83f30e
+        while i < len(test_descr.main_program):
83f30e
+            s = test_descr.main_program[i]
83f30e
+            obj = s[1:]
83f30e
+            dso = test_name + "-" + obj
83f30e
+            if s[0] == '+' or s[0] == '^':
83f30e
+                if s[0] == '+':
83f30e
+                    dlopen_flags = "RTLD_LAZY|RTLD_GLOBAL"
83f30e
+                    f.write("  putchar('+');\n");
83f30e
+                else:
83f30e
+                    dlopen_flags = "RTLD_LAZY"
83f30e
+                    f.write("  putchar(':');\n");
83f30e
+                if len(obj) == 1:
83f30e
+                    f.write("  putchar('%s');\n" % (obj));
83f30e
+                else:
83f30e
+                    f.write('  printf("%s");\n' % (obj));
83f30e
+                f.write("  putchar('[');\n");
83f30e
+                f.write('  void *%s = dlopen ("%s.so", %s);\n'
83f30e
+                         % (obj, dso, dlopen_flags))
83f30e
+                put_fail_check("!%s" % (obj),
83f30e
+                                "%s.so dlopen" % (dso))
83f30e
+                f.write("  putchar(']');\n");
83f30e
+            elif s[0] == '-':
83f30e
+                f.write("  putchar('-');\n");
83f30e
+                if len(obj) == 1:
83f30e
+                    f.write("  putchar('%s');\n" % (obj));
83f30e
+                else:
83f30e
+                    f.write('  printf("%s");\n' % (obj));
83f30e
+                f.write("  putchar('[');\n");
83f30e
+                put_fail_check("dlclose (%s) != 0" % (obj),
83f30e
+                                "%s.so dlclose" % (dso))
83f30e
+                f.write("  putchar(']');\n");
83f30e
+            elif s[0] == '%':
83f30e
+                f.write("  putchar('%');\n");
83f30e
+                f.write('  void (*fn_%s)(void) = dlsym (%s, "fn_%s");\n'
83f30e
+                         % (obj, obj, obj))
83f30e
+                put_fail_check("!fn_%s" % (obj),
83f30e
+                                "dlsym(fn_%s) from %s.so" % (obj, dso))
83f30e
+                f.write("  fn_%s ();\n" % (obj))
83f30e
+            elif s[0] == '@':
83f30e
+                f.write("  putchar('@');\n");
83f30e
+                f.write("  fn_%s ();\n" % (obj))
83f30e
+            f.write("  putchar(';');\n");
83f30e
+            i += 1
83f30e
+        f.write("  putchar('}');\n")
83f30e
+        f.write("  return 0;\n")
83f30e
+        f.write("}\n")
83f30e
+        f.close()
83f30e
+
83f30e
+        # --build option processing: build generated sources using 'build_gcc'
83f30e
+        if cmdlineargs.build:
83f30e
+            # Helper routine to run a shell command, for running GCC below
83f30e
+            def run_cmd(args):
83f30e
+                cmd = str.join(' ', args)
83f30e
+                if cmdlineargs.debug_output:
83f30e
+                    print(cmd)
83f30e
+                p = subprocess.Popen(args)
83f30e
+                p.wait()
83f30e
+                if p.returncode != 0:
83f30e
+                    error("error running command: %s" % (cmd))
83f30e
+
83f30e
+            # Compile individual .os files
83f30e
+            for obj in test_descr.objs:
83f30e
+                src_name = test_name + "-" + obj + ".c"
83f30e
+                obj_name = test_name + "-" + obj + ".os"
83f30e
+                run_cmd([build_gcc, "-c", "-fPIC", testpfx + src_name,
83f30e
+                          "-o", testpfx + obj_name])
83f30e
+
83f30e
+            obj_processed = {}
83f30e
+            fake_created = {}
83f30e
+            # Function to create <test_name>-<obj>.so
83f30e
+            def build_dso(obj):
83f30e
+                obj_name = test_name + "-" + obj + ".os"
83f30e
+                dso_name = test_name + "-" + obj + ".so"
83f30e
+                deps = []
83f30e
+                if obj in test_descr.deps:
83f30e
+                    for dep in test_descr.deps[obj]:
83f30e
+                        if dep in obj_processed:
83f30e
+                            deps.append(dep)
83f30e
+                        else:
83f30e
+                            deps.append(dep + ".FAKE")
83f30e
+                            if not dep in fake_created:
83f30e
+                                base_name = testpfx + test_name + "-" + dep
83f30e
+                                cmd = [build_gcc, "-Wl,--no-as-needed",
83f30e
+                                       ("-Wl,-soname=" + base_name + ".so"),
83f30e
+                                       "-shared", base_name + ".FAKE.c",
83f30e
+                                       "-o", base_name + ".FAKE.so"]
83f30e
+                                run_cmd(cmd)
83f30e
+                                fake_created[dep] = True
83f30e
+                dso_deps = map(lambda d: testpfx + test_name + "-" + d + ".so",
83f30e
+                               deps)
83f30e
+                cmd = [build_gcc, "-shared", "-o", testpfx + dso_name,
83f30e
+                       testpfx + obj_name, "-Wl,--no-as-needed"]
83f30e
+                if obj in test_descr.soname_map:
83f30e
+                    soname = ("-Wl,-soname=" + testpfx + test_name + "-"
83f30e
+                              + test_descr.soname_map[obj] + ".so")
83f30e
+                    cmd += [soname]
83f30e
+                cmd += list(dso_deps)
83f30e
+                run_cmd(cmd)
83f30e
+                obj_processed[obj] = True
83f30e
+
83f30e
+            # Build all DSOs, this needs to be in topological dependency order,
83f30e
+            # or link will fail
83f30e
+            dfs(test_descr, build_dso)
83f30e
+
83f30e
+            # Build main program
83f30e
+            deps = []
83f30e
+            if '#' in test_descr.deps:
83f30e
+                deps = test_descr.deps['#']
83f30e
+            main_deps = map(lambda d: testpfx + test_name + "-" + d + ".so",
83f30e
+                            deps)
83f30e
+            cmd = [build_gcc, "-Wl,--no-as-needed", "-o", testpfx + test_name,
83f30e
+                   testpfx + test_name + ".c", "-L%s" % (os.getcwd()),
83f30e
+                   "-Wl,-rpath-link=%s" % (os.getcwd())]
83f30e
+            if '#' in test_descr.soname_map:
83f30e
+                soname = ("-Wl,-soname=" + testpfx + test_name + "-"
83f30e
+                          + test_descr.soname_map['#'] + ".so")
83f30e
+                cmd += [soname]
83f30e
+            cmd += list(main_deps)
83f30e
+            run_cmd(cmd)
83f30e
+
83f30e
+    # Check if we need to enumerate permutations of dependencies
83f30e
+    need_permutation_processing = False
83f30e
+    if t.dep_permutations:
83f30e
+        # Adjust dep_permutations into map of object -> dependency permutations
83f30e
+        for r in t.dep_permutations.items():
83f30e
+            obj = r[0]
83f30e
+            if obj in t.deps and len(t.deps[obj]) > 1:
83f30e
+                deps = t.deps[obj]
83f30e
+                t.dep_permutations[obj] = list(itertools.permutations (deps))
83f30e
+                need_permutation_processing = True
83f30e
+
83f30e
+    def enum_permutations(t, perm_list):
83f30e
+        test_subindex = 1
83f30e
+        curr_perms = []
83f30e
+        def enum_permutations_rec(t, perm_list):
83f30e
+            nonlocal test_subindex, curr_perms
83f30e
+            if len(perm_list) >= 1:
83f30e
+                curr = perm_list[0]
83f30e
+                obj = curr[0]
83f30e
+                perms = curr[1]
83f30e
+                if not perms:
83f30e
+                    # This may be an empty list if no multiple dependencies to
83f30e
+                    # permute were found, skip to next in this case
83f30e
+                    enum_permutations_rec(t, perm_list[1:])
83f30e
+                else:
83f30e
+                    for deps in perms:
83f30e
+                        t.deps[obj] = deps
83f30e
+                        permstr = "" if obj == "#" else obj + "_"
83f30e
+                        permstr += str.join('', deps)
83f30e
+                        curr_perms.append(permstr)
83f30e
+                        enum_permutations_rec(t, perm_list[1:])
83f30e
+                        curr_perms = curr_perms[0:len(curr_perms)-1]
83f30e
+            else:
83f30e
+                # t.deps is now instantiated with one dependency order
83f30e
+                # permutation(across all objects that have multiple
83f30e
+                # permutations), now process a testcase
83f30e
+                generate_testcase(t, ("_" + str (test_subindex)
83f30e
+                                       + "-" + str.join('-', curr_perms)))
83f30e
+                test_subindex += 1
83f30e
+        enum_permutations_rec(t, perm_list)
83f30e
+
83f30e
+    # Create *.exp files with expected outputs
83f30e
+    for r in t.expected_outputs.items():
83f30e
+        sfx = ""
83f30e
+        if r[0] != "":
83f30e
+            sfx = "-" + r[0].replace("=","_")
83f30e
+        f = open(testpfx + t.test_name + sfx + ".exp", "w")
83f30e
+        (output, xfail) = r[1]
83f30e
+        f.write('%s' % output)
83f30e
+        f.close()
83f30e
+
83f30e
+    # Create header part of top-level testcase shell script, to wrap execution
83f30e
+    # and output comparison together.
83f30e
+    t.sh = open(testpfx + t.test_name + ".sh", "w")
83f30e
+    t.sh.write("#!/bin/sh\n")
83f30e
+    t.sh.write("# Test driver for %s, generated by "
83f30e
+                "dso-ordering-test.py\n" % (t.test_name))
83f30e
+    t.sh.write("common_objpfx=$1\n")
83f30e
+    t.sh.write("test_wrapper_env=$2\n")
83f30e
+    t.sh.write("run_program_env=$3\n")
83f30e
+    t.sh.write("something_failed=false\n")
83f30e
+
83f30e
+    # Starting part of Makefile fragment
83f30e
+    makefile.write("ifeq (yes,$(build-shared))\n")
83f30e
+
83f30e
+    if need_permutation_processing:
83f30e
+        enum_permutations(t, list (t.dep_permutations.items()))
83f30e
+    else:
83f30e
+        # We have no permutations to enumerate, just process testcase normally
83f30e
+        generate_testcase(t, "")
83f30e
+
83f30e
+    # If testcase is XFAIL, indicate so
83f30e
+    if t.xfail:
83f30e
+        makefile.write("test-xfail-%s = yes\n" % t.test_name)
83f30e
+
83f30e
+    # Output end part of Makefile fragment
83f30e
+    expected_output_files = ""
83f30e
+    for r in t.expected_outputs.items():
83f30e
+        sfx = ""
83f30e
+        if r[0] != "":
83f30e
+            sfx = "-" + r[0].replace("=","_")
83f30e
+        expected_output_files += " $(objpfx)%s/%s%s.exp" % (test_subdir,
83f30e
+                                                            t.test_name, sfx)
83f30e
+    makefile.write \
83f30e
+    ("$(objpfx)%s.out: $(objpfx)%s/%s.sh%s "
83f30e
+     "$(common-objpfx)support/test-run-command\n"
83f30e
+     % (t.test_name, test_subdir, t.test_name,
83f30e
+        expected_output_files))
83f30e
+    makefile.write("\t$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' "
83f30e
+                    "'$(run-program-env)' > $@; $(evaluate-test)\n")
83f30e
+    makefile.write("ifeq ($(run-built-tests),yes)\n")
83f30e
+    if t.xtest:
83f30e
+        makefile.write("xtests-special += $(objpfx)%s.out\n" % (t.test_name))
83f30e
+    else:
83f30e
+        makefile.write("tests-special += $(objpfx)%s.out\n" % (t.test_name))
83f30e
+    makefile.write("endif\n")
83f30e
+    makefile.write("endif\n")
83f30e
+
83f30e
+    # Write ending part of shell script generation
83f30e
+    t.sh.write("if $something_failed; then\n"
83f30e
+                "  exit 1\n"
83f30e
+                "else\n"
83f30e
+                "  echo '%sPASS: all tests for %s succeeded'\n"
83f30e
+                "  exit 0\n"
83f30e
+                "fi\n" % (("X" if t.xfail else ""),
83f30e
+                          t.test_name))
83f30e
+    t.sh.close()
83f30e
+
83f30e
+# Decription file parsing
83f30e
+def parse_description_file(filename):
83f30e
+    global default_tunable_options
83f30e
+    global current_input_lineno
83f30e
+    f = open(filename)
83f30e
+    if not f:
83f30e
+        error("cannot open description file %s" % (filename))
83f30e
+    descrfile_lines = f.readlines()
83f30e
+    t = None
83f30e
+    for line in descrfile_lines:
83f30e
+        p = re.compile(r"#.*$")
83f30e
+        line = p.sub("", line) # Filter out comments
83f30e
+        line = line.strip() # Remove excess whitespace
83f30e
+        current_input_lineno += 1
83f30e
+
83f30e
+        m = re.match(r"^tunable_option:\s*(.*)$", line)
83f30e
+        if m:
83f30e
+            if m.group(1) == "":
83f30e
+                error("tunable option cannot be empty")
83f30e
+            default_tunable_options.append(m.group (1))
83f30e
+            continue
83f30e
+
83f30e
+        m = re.match(r"^clear_tunables$", line)
83f30e
+        if m:
83f30e
+            default_tunable_options = []
83f30e
+            continue
83f30e
+
83f30e
+        m = re.match(r"^([^:]+):\s*(.*)$", line)
83f30e
+        if m:
83f30e
+            lhs = m.group(1)
83f30e
+            o = re.match(r"^output(.*)$", lhs)
83f30e
+            xfail = False
83f30e
+            if not o:
83f30e
+                o = re.match(r"^xfail_output(.*)$", lhs)
83f30e
+                if o:
83f30e
+                    xfail = True;
83f30e
+            if o:
83f30e
+                if not t:
83f30e
+                    error("output specification without testcase description")
83f30e
+                tsstr = ""
83f30e
+                if o.group(1):
83f30e
+                    ts = re.match(r"^\(([a-zA-Z0-9_.=]*)\)$", o.group (1))
83f30e
+                    if not ts:
83f30e
+                        error("tunable option malformed '%s'" % o.group(1))
83f30e
+                    tsstr = ts.group(1)
83f30e
+                t.expected_outputs[tsstr] = (m.group(2), xfail)
83f30e
+                # Any tunable option XFAILed means entire testcase
83f30e
+                # is XFAIL/XPASS
83f30e
+                t.xfail |= xfail
83f30e
+            else:
83f30e
+                if t:
83f30e
+                    # Starting a new test description, end and process
83f30e
+                    # current one.
83f30e
+                    process_testcase(t)
83f30e
+                t = TestDescr()
83f30e
+                x = re.match(r"^xtest\((.*)\)$", lhs)
83f30e
+                if x:
83f30e
+                    t.xtest = True
83f30e
+                    t.test_name = x.group(1)
83f30e
+                else:
83f30e
+                    t.test_name = lhs
83f30e
+                descr_string = m.group(2)
83f30e
+                parse_description_string(t, descr_string)
83f30e
+            continue
83f30e
+        else:
83f30e
+            if line:
83f30e
+                if not t:
83f30e
+                    error("no active testcase description")
83f30e
+                parse_description_string(t, line)
83f30e
+    # Process last completed test description
83f30e
+    if t:
83f30e
+        process_testcase(t)
83f30e
+
83f30e
+# Setup Makefile output to file or stdout as selected
83f30e
+if output_makefile:
83f30e
+    output_makefile_dir = os.path.dirname(output_makefile)
83f30e
+    if output_makefile_dir:
83f30e
+        os.makedirs(output_makefile_dir, exist_ok = True)
83f30e
+    makefile = open(output_makefile, "w")
83f30e
+else:
83f30e
+    makefile = open(sys.stdout.fileno (), "w")
83f30e
+
83f30e
+# Finally, the main top-level calling of above parsing routines.
83f30e
+if description_file:
83f30e
+    parse_description_file(description_file)
83f30e
+else:
83f30e
+    t = TestDescr()
83f30e
+    t.test_name = test_name
83f30e
+    parse_description_string(t, description)
83f30e
+    process_testcase(t)
83f30e
+
83f30e
+# Close Makefile fragment output
83f30e
+makefile.close()
83f30e
diff --git a/support/Depend b/support/Depend
83f30e
new file mode 100644
83f30e
index 0000000000000000..7e7d5dc67c13e669
83f30e
--- /dev/null
83f30e
+++ b/support/Depend
83f30e
@@ -0,0 +1 @@
83f30e
+elf
83f30e
diff --git a/support/Makefile b/support/Makefile
83f30e
index 7749ac24f1ac3622..636d69c4f8e7e139 100644
83f30e
--- a/support/Makefile
83f30e
+++ b/support/Makefile
83f30e
@@ -215,10 +215,16 @@ others-noinstall += shell-container echo-container true-container
83f30e
 others += $(LINKS_DSO_PROGRAM)
83f30e
 others-noinstall += $(LINKS_DSO_PROGRAM)
83f30e
 
83f30e
+others += test-run-command
83f30e
+others-static += test-run-command
83f30e
+others-noinstall += test-run-command
83f30e
+LDLIBS-test-run-command = $(libsupport)
83f30e
+
83f30e
 $(objpfx)test-container : $(libsupport)
83f30e
 $(objpfx)shell-container : $(libsupport)
83f30e
 $(objpfx)echo-container : $(libsupport)
83f30e
 $(objpfx)true-container : $(libsupport)
83f30e
+$(objpfx)test-run-command : $(libsupport) $(common-objpfx)elf/static-stubs.o
83f30e
 
83f30e
 tests = \
83f30e
   README-testing \
83f30e
diff --git a/support/support_test_main.c b/support/support_test_main.c
83f30e
index def84d803928176b..49e9d9c5baf776eb 100644
83f30e
--- a/support/support_test_main.c
83f30e
+++ b/support/support_test_main.c
83f30e
@@ -228,6 +228,18 @@ run_test_function (int argc, char **argv, const struct test_config *config)
83f30e
   while (wait_for_debugger)
83f30e
     usleep (1000);
83f30e
 
83f30e
+  if (config->run_command_mode)
83f30e
+    {
83f30e
+      /* In run-command-mode, the child process executes the command line
83f30e
+	 arguments as a new program.  */
83f30e
+      char **argv_ = xmalloc (sizeof (char *) * argc);
83f30e
+      memcpy (argv_, &argv[1], sizeof (char *) * (argc - 1));
83f30e
+      argv_[argc - 1] = NULL;
83f30e
+      execv (argv_[0], argv_);
83f30e
+      printf ("error: should not return here\n");
83f30e
+      exit (1);
83f30e
+    }
83f30e
+
83f30e
   if (config->test_function != NULL)
83f30e
     return config->test_function ();
83f30e
   else if (config->test_function_argv != NULL)
83f30e
diff --git a/support/test-driver.c b/support/test-driver.c
83f30e
index 9798f16227b9d467..93f25a99c1b9d2cb 100644
83f30e
--- a/support/test-driver.c
83f30e
+++ b/support/test-driver.c
83f30e
@@ -116,7 +116,9 @@ main (int argc, char **argv)
83f30e
 #if defined (TEST_FUNCTION) && defined (TEST_FUNCTON_ARGV)
83f30e
 # error TEST_FUNCTION and TEST_FUNCTION_ARGV cannot be defined at the same time
83f30e
 #endif
83f30e
-#if defined (TEST_FUNCTION)
83f30e
+#ifdef RUN_COMMAND_MODE
83f30e
+  test_config.run_command_mode = 1;
83f30e
+#elif defined (TEST_FUNCTION)
83f30e
   test_config.test_function = TEST_FUNCTION;
83f30e
 #elif defined (TEST_FUNCTION_ARGV)
83f30e
   test_config.test_function_argv = TEST_FUNCTION_ARGV;
83f30e
diff --git a/support/test-driver.h b/support/test-driver.h
83f30e
index 549179b254946390..818689ad1ae7fd8c 100644
83f30e
--- a/support/test-driver.h
83f30e
+++ b/support/test-driver.h
83f30e
@@ -36,6 +36,7 @@ struct test_config
83f30e
   int expected_signal;   /* If non-zero, expect termination by signal.  */
83f30e
   char no_mallopt;       /* Boolean flag to disable mallopt.  */
83f30e
   char no_setvbuf;       /* Boolean flag to disable setvbuf.  */
83f30e
+  char run_command_mode; /* Boolean flag to indicate run-command-mode.  */
83f30e
   const char *optstring; /* Short command line options.  */
83f30e
 };
83f30e
 
83f30e
diff --git a/support/test-run-command.c b/support/test-run-command.c
83f30e
new file mode 100644
83f30e
index 0000000000000000..61560d7bfb1686a8
83f30e
--- /dev/null
83f30e
+++ b/support/test-run-command.c
83f30e
@@ -0,0 +1,22 @@
83f30e
+/* Main program for test-run-command support utility.
83f30e
+   Copyright (C) 2021 Free Software Foundation, Inc.
83f30e
+   This file is part of the GNU C Library.
83f30e
+
83f30e
+   The GNU C Library is free software; you can redistribute it and/or
83f30e
+   modify it under the terms of the GNU Lesser General Public
83f30e
+   License as published by the Free Software Foundation; either
83f30e
+   version 2.1 of the License, or (at your option) any later version.
83f30e
+
83f30e
+   The GNU C Library is distributed in the hope that it will be useful,
83f30e
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
83f30e
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
83f30e
+   Lesser General Public License for more details.
83f30e
+
83f30e
+   You should have received a copy of the GNU Lesser General Public
83f30e
+   License along with the GNU C Library; if not, see
83f30e
+   <https://www.gnu.org/licenses/>.  */
83f30e
+
83f30e
+/* This is basically a configuration of test-driver.c into a general
83f30e
+   command-line program runner.  */
83f30e
+#define RUN_COMMAND_MODE
83f30e
+#include <test-driver.c>