[crt][test] Make ctor_dtor.c robust if DT_INIT/DT_FINI is disabled
authorFangrui Song <i@maskray.me>
Thu, 12 Aug 2021 16:31:31 +0000 (09:31 -0700)
committerFangrui Song <i@maskray.me>
Thu, 12 Aug 2021 16:31:31 +0000 (09:31 -0700)
commitc520863abb901912799a1178a6caa9079f6214bf
tree9d65f2f9f83af2a12cc701b425e59d3fdbaa0b2d
parentb6113548c9217fb8a6d0e9ac5bef5584c1aa614d
[crt][test] Make ctor_dtor.c robust if DT_INIT/DT_FINI is disabled

New ports in glibc typically don't define ELF_INITFINI, so
DT_INIT/DT_FINI support is disabled.
(rhel ppc64le likely patches their glibc this way as well.)
musl can disable DT_INIT/DT_FINI via -DNO_LEGACY_INITFINI.

So we cannot guarantee ctor()/dtor() will be printed.
compiler-rt/test/crt/ctor_dtor.c