Dave Korn <dave.korn.cyg...@gmail.com> writes: > Well, at least on PE-COFF, the numeric string is (65536-priority). It is > zero padded to five digits, so that the linker's alphabetical sort effectively > becomes a numeric sort, and the reason for the inverting the numeric order of > priorities is because .ctors gets read backwards at startup.
Same on ELF (except that on ARM EABI it uses .init_array and does not subtract from 65535; see arm_elf_asm_cdtor). Ian