[GHC] #13883: T5435_dyn_asm fails with ld.gold

GHC ghc-devs at haskell.org
Tue Jun 27 16:25:42 UTC 2017


#13883: T5435_dyn_asm fails with ld.gold
-------------------------------------+-------------------------------------
           Reporter:  bgamari        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I'm seeing `T5435_dyn_asm` fail with Phab: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
 [[https://gcc.gnu.org/onlinedocs/gccint/Initialization.html|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.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13883>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list