[GHC] #8564: Unhandled ELF relocation types on dynamically loading object files with GHCi

#8564: Unhandled ELF relocation types on dynamically loading object files with GHCi ------------------------------------+------------------------------- Reporter: pgj | Owner: pgj Type: task | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Keywords: | Operating System: FreeBSD Architecture: Unknown/Multiple | Type of failure: GHCi crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------- GHCi cannot handle ELF symbols with relocation types 15 (i386) and 22 (amd64) (such as {{{ThreadRuneLocale}}}, coming from libc on systems later than 9.0) when dynamically loading object files. This can be reproduced by the issuing the following commands: {{{ # pkg install hs-hs-bibutils .. $ ghci Prelude> :m Text.Bibutils Prelude> bibl_init Loading package syb-0.4.0 ... linking ... done. Loading package hs-bibutils-5.0 ... linking ... <interactive>: /usr/local/lib/cabal/ghc-7.6.3/hs-bibutils-5.0/HShs-bibutils-5.0.o: unhandled ELF relocation(Rel) type 15 ghc: unable to load package `hs-bibutils-5.0' Prelude> }}} The source file {{{rts/Linker.c}}}, function {{{do_Elf_Rela_relocations()}}} is missing the case branches for types 15 ({{{R_386_TLS_IE}}}) and 22 ({{{R_X86_64_GOTTPOFF}}}). They shall be implemented for FreeBSD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8564 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8564: Unhandled ELF relocation types on dynamically loading object files with GHCi -------------------------------+------------------------------------ Reporter: pgj | Owner: pgj Type: task | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------ Comment (by carter): does the same problem happen in ghci in head? 'cause i think ghci 7.7 / HEAD on those platforms should be using the system dy linker. That said, definitely should be fixed! :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8564#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8564: Unhandled ELF relocation types on dynamically loading object files with GHCi -------------------------------+------------------------------------ Reporter: pgj | Owner: pgj Type: task | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------ Comment (by pgj): Replying to [comment:1 carter]:
does the same problem happen in ghci in head?
Yes, I have just tested with the snapshot of today on i386. {{{R_X86_64_GOTTPOFF}}} is implemented for !DragonFly BSD only, while {{{R_386_TLS_IE}}} does not seem to be handled everywhere at all.
'cause i think ghci 7.7 / HEAD on those platforms should be using the system dy linker.
I am not entirely familiar with the internals of the GHCi linker, but apparently it directly loads {{{.o}}} files and that is where it relies on the routines of {{{rts/Linker.c}}}. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8564#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8564: Unhandled ELF relocation types on dynamically loading object files with GHCi -------------------------------+------------------------------------ Reporter: pgj | Owner: pgj Type: task | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------ Comment (by carter): ok fair enough, I'm not super familiar with those pieces as yet myself, hence wondering outloud. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8564#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8564: Unhandled ELF relocation types on dynamically loading object files with GHCi -------------------------------+------------------------------------ Reporter: pgj | Owner: pgj Type: task | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------ Comment (by pgj): Hm, it seems this is not required anymore since setting `DYNAMIC_GHC_PROGRAMS=YES` as default for FreeBSD too solves it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8564#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8564: Unhandled ELF relocation types on dynamically loading object files with GHCi -------------------------------+------------------------------------ Reporter: pgj | Owner: pgj Type: task | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: wontfix | Keywords: Operating System: FreeBSD | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------ Changes (by pgj): * status: new => closed * resolution: => wontfix -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8564#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC