Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 635
    • Merge requests 635
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1343

HEAD build failure with assember errors about "8 byte pc-relative relocation"

When building HEAD (7/5/07) on x86-64 Gentoo Linux with binutils-2.16.1 we get an error when stage1 is compiling the rts:

../compiler/ghc-inplace -H16m -O -optc-O2 -static -I. -#include HCIncludes.h -fvia-C -dcmm-lint     -c StgMiscClosures.cmm -o StgMiscClosures.o
/tmp/ghc27655_0/ghc27655_0.s: Assembler messages:

/tmp/ghc27655_0/ghc27655_0.s:434:0:
     Error: can not do 8 byte pc-relative relocation

And 8 more errors of the same form later in the file. Looking at the generated .s file we see the offending lines are of the form:

.globl stg_DEAD_WEAK_info
        .type   stg_DEAD_WEAK_info, @object
        .size   stg_DEAD_WEAK_info, 24
        .quad   cv_str - stg_DEAD_WEAK_info    // offending line

cv_str is defined a few lines earlier in the .rodata section, while .globl stg_DEAD_WEAK_info is defined in the .text section.

In the .hc file it looked like:

static char cv_str[] = "DEAD_WEAK";

static char cx_str[] = "DEAD_WEAK object entered!";

StgWord stg_DEAD_WEAK_info[] = {
((W_)&cv_str+0), 0x400000000UL, 0x1UL
};

which became:

cv_str:
        .string "DEAD_WEAK"
.section        .rodata
        .align 8
        .type   cx_str, @object
        .size   cx_str, 26
cx_str:
        .string "DEAD_WEAK object entered!"
.text
        .align 8
.globl stg_DEAD_WEAK_info
        .type   stg_DEAD_WEAK_info, @object
        .size   stg_DEAD_WEAK_info, 24
        .quad   cv_str - stg_DEAD_WEAK_info
        .quad   17179869184
        .quad   1

It's interesting to note that this assembler output was of course generated by gcc (version 4.1.1).

(Ian asked me to mark this bug as high priorty for 6.8)

Trac metadata
Trac field Value
Version 6.7
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking