Opened 3 years ago

Closed 3 years ago

#9116 closed bug (fixed)

RTS Linker doesn't recognize .text.unlikely section on Windows

Reported by: niklasl Owned by: simonmar
Priority: normal Milestone:
Component: Runtime System Version: 7.8.2
Keywords: Cc: simonmar, rcook
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When trying to use a newer gcc with GHC 7.8.2, some .o files are rejected by the linker for containing a .text.unlikely section with the following message:

Loading package text- ... ghc.exe: panic! (the 'impossible' happened)

  (GHC version 7.8.2 for x86_64-unknown-mingw32):

	loadObj "C:\\Niklas\\src\\Idris-dev\\.cabal-sandbox\\x86_64-windows-ghc-7.8.2\\text-\\HStext-": failed

Please report this as a GHC bug:

ghc.exe: Unknown PEi386 section name `.text.unlikely' (while processing: C:\Niklas\src\Idris-dev\.cabal-sandbox\x86_64-windows-ghc-7.8.2\text-\HStext-

This comes from the ocGetNames_PEi386 function in rts/Linker.c. There is a list of section names recognized as code sections at line 4146- in that file. The fix is to add .text.unlikely there, or maybe the right solution is to cast the net wider and accept .text.* as code sections.

Change History (4)

comment:1 Changed 3 years ago by niklasl

Forgot to say that the newer gcc in question was version 4.9.0.

comment:2 Changed 3 years ago by rcook

Cc: rcook added

Bug is probably a duplicate of

comment:3 Changed 3 years ago by niklasl

If it can happen with the mingw distributed with GHC it's quite a bit more urgent to fix. Added a patch to #9080.

comment:4 Changed 3 years ago by niklasl

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.