On systems where it is supported an alternative mechanism is used that puts the destructors into the .fini_array
section. The symbols denoting the start and the end are __fini_array_start
and __fini_array_end
, respectively, but they are marked as hidden. You can look at the section header to find the destructor table:
$ objdump -h -j .fini_array a.out
a.out: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
19 .fini_array 00000008 0804959c 0804959c 0000059c 2**2
CONTENTS, ALLOC, LOAD, DATA
__do_global_dtors_aux_fini_array_entry
is an entry in this .fini_array
section that points to __do_global_dtors_aux
which does some libc cleanup. This function also runs the destructors on systems where the .fini_array
mechanism is not used.
TL;DR: the table is in the .fini_array
section, do whatever you want with it.