Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,842
    • Issues 4,842
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9439

Closed
Open
Created Aug 14, 2014 by Ben Gamari@bgamari🐢Maintainer

LlvmCodegen: Overzealous mangler incorrectly transforms user code

In an attempt to close #4210 (closed) the LLVM code generator's mangler was modified in ed67d290 to rewrite symbol types from @function to @object. This was done in order to prevent the linker from sending reference through the PLT which breaks info tables.

Unfortunately, this mangling was a simple text replacement of @function to @object in the assembler produced by LLVM and made no attempt to distinguish .type directives (which the mangling targets) from other occurrences of the token. As rwbarton unfortunately found out, this means that any occurrences of "@function" in user code (e.g. the LLVM backend itself while compiling GHC) will be rewritten to "@object" in the produced object. Hilarity ensues.

This can be demonstrated by the simple test main = putStrLn "@function", which prints @object in the affected releases (7.8.1 through 7.8.3 thusfar).

Trac metadata
Trac field Value
Version 7.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (LLVM)
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