https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261
--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #12) > (In reply to Gaius Mulley from comment #11) > > > when a module has the same name but a different interface are the > > symbols distinct (i.e. mangled differently)? > > > > no. So, as you say, the ordering of the static link works fine. I > > had assumed that dynamic libraries also adhered to a similar ordering. > > From what we are observing it seems that all the ctors fire but the > > API integrity is preserved due to library ordering? (Or have I > > misunderstood dynamic linking?). (Or worse this might be true on > > gnu/linux but not on other platforms?). > > comment #6 seems to indicate possible issues on linux too? (or I > misunderstand) > > To find out what's actually happening will mean digging through the init in > the debugger .. One additional thought, perhaps lazy binding could be responsible; usually Darwin will not bind symbols on load, but on first use (speeds up startup). However there is an option to force bind-on-load (when I get a chance, will try that - then I suppose that the order of library load should mean that the symbols are then bound in that order too). I do not know enough about Linux ld.so to comment on what might happen there.