Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Craig Ferguson
GHC
Commits
3dbc6ac6
Commit
3dbc6ac6
authored
4 years ago
by
Moritz Angermann
Browse files
Options
Downloads
Patches
Plain Diff
Trying to get PIC right.
parent
34c6c6d7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compiler/GHC/Cmm/CLabel.hs
+4
-0
4 additions, 0 deletions
compiler/GHC/Cmm/CLabel.hs
compiler/GHC/CmmToAsm/PIC.hs
+13
-6
13 additions, 6 deletions
compiler/GHC/CmmToAsm/PIC.hs
with
17 additions
and
6 deletions
compiler/GHC/Cmm/CLabel.hs
+
4
−
0
View file @
3dbc6ac6
...
...
@@ -1436,6 +1436,10 @@ pprDynamicLinkerAsmLabel platform dllInfo lbl =
SymbolPtr
->
text
".LC_"
<>
ppr
lbl
_
->
panic
"pprDynamicLinkerAsmLabel"
|
platformArch
platform
==
ArchAArch64
=
ppr
lbl
|
platformArch
platform
==
ArchX86_64
=
case
dllInfo
of
CodeStub
->
ppr
lbl
<>
text
"@plt"
...
...
This diff is collapsed.
Click to expand it.
compiler/GHC/CmmToAsm/PIC.hs
+
13
−
6
View file @
3dbc6ac6
...
...
@@ -133,6 +133,14 @@ cmmMakeDynamicReference config referenceKind lbl
addImport
stub
return
$
CmmLit
$
CmmLabel
stub
-- GOT relative loads work differently on AArch64. We don't
-- the got symbol is loaded directly, and not through an additional
-- load.
AccessViaSymbolPtr
|
ArchAArch64
<-
platformArch
platform
->
do
let
symbolPtr
=
mkDynamicLinkerLabel
SymbolPtr
lbl
addImport
symbolPtr
return
$
cmmMakePicReference
config
symbolPtr
AccessViaSymbolPtr
->
do
let
symbolPtr
=
mkDynamicLinkerLabel
SymbolPtr
lbl
addImport
symbolPtr
...
...
@@ -146,7 +154,6 @@ cmmMakeDynamicReference config referenceKind lbl
-- so just jump there if it's a call or a jump
_
->
return
$
CmmLit
$
CmmLabel
lbl
-- -----------------------------------------------------------------------------
-- Create a position independent reference to a label.
-- (but do not bother with dynamic linking).
...
...
@@ -261,11 +268,11 @@ howToAccessLabel config _ OSMinGW32 this_mod _ lbl
-- is enough for ~64MB of range. Anything else will need to go through a veneer,
-- which is the job of the linker to build. We might only want to lookup
-- Data References through the GOT.
howToAccessLabel
_config
ArchAArch64
_os
_this_mod
kind
_lbl
=
case
kind
of
DataReference
->
AccessDirectly
-- AccessViaSymbolPtr
CallReference
->
AccessDirectly
JumpReference
->
AccessDirectly
--
howToAccessLabel _config ArchAArch64 _os _this_mod kind _lbl
--
= case kind of
--
DataReference -> AccessDirectly -- AccessViaSymbolPtr
--
CallReference -> AccessDirectly
--
JumpReference -> AccessDirectly
-- Mach-O (Darwin, Mac OS X)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment