android_mt6572_jiabo/ndk/tests/standalone/init-fini-arrays
2025-09-05 16:56:03 +08:00
..
foo.cpp first commit 2025-09-05 16:56:03 +08:00
README first commit 2025-09-05 16:56:03 +08:00
run.sh first commit 2025-09-05 16:56:03 +08:00

This test is here to check that all constructors and destructors
are placed in the .init_array and .fini_array sections. More precisely:

  - The address of functions with __attribute__((constructor)) are placed in
    the .init_array section.

  - The address of functions with __attribute__((destructor)) are placed in
    the .fini_array section

  - The address of static C++ constructors are placed in the .init_array
    section. There is no corresponding entry in the .fini_array for the
    corresponding destructors. Instead, the constructor must call __cxa_atexit
    to register the destructors manually.

The main idea is to check that there is no .ctors or .dtors section in the
generated shared library.