Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,268
Issues
4,268
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
408
Merge Requests
408
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
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
ed67d290
Commit
ed67d290
authored
Dec 14, 2013
by
Ben Gamari
Committed by
Austin Seipp
Jan 07, 2014
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LlvmMangler: Rewrite @function symbols to @object
Signed-off-by:
Austin Seipp
<
austin@well-typed.com
>
parent
032969f7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
compiler/llvmGen/LlvmMangler.hs
compiler/llvmGen/LlvmMangler.hs
+11
-5
No files found.
compiler/llvmGen/LlvmMangler.hs
View file @
ed67d290
...
...
@@ -51,11 +51,17 @@ llvmFixupAsm dflags f1 f2 = {-# SCC "llvm_mangler" #-} do
w
<-
openBinaryFile
f2
WriteMode
ss
<-
readSections
r
w
hClose
r
let
fixed
=
(
map
rewriteAVX
.
fixTables
)
ss
let
fixed
=
(
map
(
rewriteSymType
.
rewriteAVX
)
.
fixTables
)
ss
mapM_
(
writeSection
w
)
fixed
hClose
w
return
()
rewriteSymType
::
Section
->
Section
rewriteSymType
=
rewriteInstructions
typeFunc
typeObj
where
typeFunc
=
B
.
pack
"@function"
typeObj
=
B
.
pack
"@object"
-- | Splits the file contents into its sections
readSections
::
Handle
->
Handle
->
IO
[
Section
]
readSections
r
w
=
go
B
.
empty
[]
[]
...
...
@@ -111,6 +117,10 @@ rewriteVmovap = rewriteInstructions vmovap vmovup
vmovap
,
vmovup
::
B
.
ByteString
vmovap
=
B
.
pack
"vmovap"
vmovup
=
B
.
pack
"vmovup"
#
else
/*
!
REWRITE_AVX
*/
rewriteAVX
::
Section
->
Section
rewriteAVX
=
id
#
endif
/*
!
REWRITE_SSE
*/
rewriteInstructions
::
B
.
ByteString
->
B
.
ByteString
->
Section
->
Section
rewriteInstructions
matchBS
replaceBS
(
hdr
,
cts
)
=
...
...
@@ -122,10 +132,6 @@ rewriteInstructions matchBS replaceBS (hdr, cts) =
(
hd
,
tl
)
|
B
.
null
tl
->
hd
|
otherwise
->
hd
`
B
.
append
`
replaceBS
`
B
.
append
`
loop
(
B
.
drop
(
B
.
length
matchBS
)
tl
)
#
else
/*
!
REWRITE_AVX
*/
rewriteAVX
::
Section
->
Section
rewriteAVX
=
id
#
endif
/*
!
REWRITE_SSE
*/
-- | Reorder and convert sections so info tables end up next to the
-- code. Also does stack fixups.
...
...
Ben Gamari
🐢
@bgamari
mentioned in issue
#9439 (closed)
·
Aug 14, 2014
mentioned in issue
#9439 (closed)
mentioned in issue #9439
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment