Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alex D
GHC
Commits
04f3524f
Commit
04f3524f
authored
Jan 04, 2016
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linker: ARM: Don't change to BLX if jump needed veneer
Since we produce ARM veneer.
parent
1dbc8d91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
rts/Linker.c
rts/Linker.c
+5
-2
No files found.
rts/Linker.c
View file @
04f3524f
...
...
@@ -5137,7 +5137,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
const
StgBool
overflow
=
!
is_int
(
26
,
(
StgInt32
)
result
);
// Handle overflow and Thumb interworking
if
((
is_target_thm
&&
ELF_R_TYPE
(
info
)
==
R_ARM_JUMP24
)
||
overflow
)
{
const
StgBool
needs_veneer
=
(
is_target_thm
&&
ELF_R_TYPE
(
info
)
==
R_ARM_JUMP24
)
||
overflow
;
if
(
needs_veneer
)
{
// Generate veneer
// The +8 below is to undo the PC-bias compensation done by the object producer
SymbolExtra
*
extra
=
makeArmSymbolExtra
(
oc
,
ELF_R_SYM
(
info
),
S
+
imm
+
8
,
0
,
is_target_thm
);
...
...
@@ -5151,12 +5152,14 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
}
}
// Update the branch target
const
StgWord32
imm24
=
(
result
&
0x03fffffc
)
>>
2
;
*
word
=
(
*
word
&
~
0x00ffffff
)
|
(
imm24
&
0x00ffffff
);
// Change the relocated branch into a BLX if necessary
const
StgBool
switch_mode
=
is_target_thm
&&
(
reloc_type
==
R_ARM_CALL
);
if
(
switch_mode
)
{
if
(
!
needs_veneer
&&
switch_mode
)
{
const
StgWord32
hBit
=
(
result
&
0x2
)
>>
1
;
// Change instruction to BLX
*
word
=
(
*
word
&
~
0xFF000000
)
|
((
0xfa
|
hBit
)
<<
24
);
...
...
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