Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,252
    • Issues 4,252
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15847

Closed
Open
Opened Nov 02, 2018 by Zejun Wu@watashiReporter

GHCi cannot load .o built from c with -fPIC on i386 linux

GHCi cannot load .o built from c with -fPIC on i386 linux. On i386 linux, the PIC object code looks like:

000001ac <hs_remWord64>:
 1ac:   53                      push   %ebx
 1ad:   83 ec 08                sub    $0x8,%esp
 1b0:   e8 fc ff ff ff          call   1b1 <hs_remWord64+0x5>
                        1b1: R_386_PC32 __x86.get_pc_thunk.bx
 1b5:   81 c3 02 00 00 00       add    $0x2,%ebx
                        1b7: R_386_GOTPC        _GLOBAL_OFFSET_TABLE_
 1bb:   ff 74 24 1c             pushl  0x1c(%esp)
 1bf:   ff 74 24 1c             pushl  0x1c(%esp)
 1c3:   ff 74 24 1c             pushl  0x1c(%esp)
 1c7:   ff 74 24 1c             pushl  0x1c(%esp)
 1cb:   e8 fc ff ff ff          call   1cc <hs_remWord64+0x20>
                        1cc: R_386_PLT32        __umoddi3
 1d0:   83 c4 18                add    $0x18,%esp
 1d3:   5b                      pop    %ebx
 1d4:   c3                      ret    
  1. the GOT symbol _GLOBAL_OFFSET_TABLE_ may be undefined
  2. the runtime linker doesn't support PIC-related i386 relocations like R_386_GOTPC or R_386_PLT32

As a result, we will see errors like unknown symbol '_GLOBAL_OFFSET_TABLE_' or unhandled ELF relocation.

Trac metadata
Trac field Value
Version 8.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System (Linker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#15847