On Wed, Feb 6, 2013 at 7:14 AM, Alexander Potapenko <gli...@google.com> wrote: > > I understand and fully support your desire for intra-module ctor/dtor > priority. > My comment was meant to reply to Mike (sorry for top-posting it, > again), who, as far as I understood him, wanted to see full > init_priority support on Darwin, which IIUC can't be implemented > without the proper linker support. LTO may help as a bandaid, but I > don't think this solution scales well enough yet.
It could be done using collect2. Though it would be a bit tedious to write. Or it could perhaps be done via a linker plugin--the Darwin linker supports plugins. I don't know if the Darwin linker has the required plugin support, but the gold linker does. Or we could just bug the Darwin guys to support it in the linker, it's clearly a useful feature, and they do have linker support. Ian