
#8696: linking fails with 'relocation R_X86_64_PC32 against undefined symbol' -----------------------------+---------------------------------- Reporter: Kata | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Other | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -----------------------------+---------------------------------- Comment (by rwbarton): The relevant code is in `compiler/ghci/Linker.lhs`, functions `linkDependencies`, `getLinkDeps`, `dynLinkObjs` and `dynLoadObjs`. When linking in a module GHC attempts to link ''all the object files that are not already loaded into GHC'' into a single shared library and then dlopen that library. That fails here because `T8696B.o` apparently contains a PC- relative relocation to `T8696A.o` and therefore cannot be dynamically linked to it. I noticed that both `getLinkDeps` and `dynLinkObjs` seem to be guilty of pruning modules/object files that have already been loaded into GHC from the list of dependencies to link together. But even if they did not prune any dependencies, would there then be problems with two copies of `T8696A.o` being loaded into GHC? So I'm not sure what the right fix is here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8696#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler