T5435_dyn_asm fails with ld.gold
T5435_dyn_asm fail with D3449 using the gold linker. Specifically,
=====> T5435_dyn_asm(normal) 1 of 1 [0, 0, 0] cd "./rts/T5435_dyn_asm.run" && $MAKE -s --no-print-directory T5435_dyn_asm T5435_dyn_asm failed with ['initArray1', 'initArray2', 'ctors2', 'ctors1', 'success'], see all.T for details *** unexpected failure for T5435_dyn_asm(normal)
It seems that the ctor list in
T5435_asm.c is in order
ctors2,ctors1 as it expects that constructors are run in reverse order, yet somehow with gold the constructors are being run in forward order.
I've searched high and low for a document specifying this behavior, but the best I can come up with is GCC's internals manual. I currently don't have a great answer for why gold flips the order. I suspected that the (enabled by default)
--ctors-in-init-array flag might have something to do with it, but alas that doesn't appear to be the case.
Anyways, given that this most certainly isn't GHC's fault and the order requirements aren't well specified anyways, I'm just going to accept the new ordering.