Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LLVM bpEVL
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Albano
LLVM bpEVL
Commits
09d5daab
Commit
09d5daab
authored
8 years ago
by
Rafael Espindola
Browse files
Options
Downloads
Patches
Plain Diff
Refactor duplicated expression. NFC.
llvm-svn: 289550
parent
a3dc05b3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lld/ELF/Relocations.cpp
+4
-4
4 additions, 4 deletions
lld/ELF/Relocations.cpp
with
4 additions
and
4 deletions
lld/ELF/Relocations.cpp
+
4
−
4
View file @
09d5daab
...
@@ -150,6 +150,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
...
@@ -150,6 +150,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
return
handleNoRelaxTlsRelocation
<
ELFT
>
(
In
<
ELFT
>::
MipsGot
,
Type
,
Body
,
C
,
return
handleNoRelaxTlsRelocation
<
ELFT
>
(
In
<
ELFT
>::
MipsGot
,
Type
,
Body
,
C
,
Offset
,
Addend
,
Expr
);
Offset
,
Addend
,
Expr
);
bool
IsPreemptible
=
isPreemptible
(
Body
,
Type
);
if
((
Expr
==
R_TLSDESC
||
Expr
==
R_TLSDESC_PAGE
||
Expr
==
R_TLSDESC_CALL
)
&&
if
((
Expr
==
R_TLSDESC
||
Expr
==
R_TLSDESC_PAGE
||
Expr
==
R_TLSDESC_CALL
)
&&
Config
->
Shared
)
{
Config
->
Shared
)
{
if
(
In
<
ELFT
>::
Got
->
addDynTlsEntry
(
Body
))
{
if
(
In
<
ELFT
>::
Got
->
addDynTlsEntry
(
Body
))
{
...
@@ -195,7 +196,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
...
@@ -195,7 +196,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
// If the symbol is preemptible we need the dynamic linker to write
// If the symbol is preemptible we need the dynamic linker to write
// the offset too.
// the offset too.
uintX_t
OffsetOff
=
Off
+
(
uintX_t
)
sizeof
(
uintX_t
);
uintX_t
OffsetOff
=
Off
+
(
uintX_t
)
sizeof
(
uintX_t
);
if
(
i
sPreemptible
(
Body
,
Type
)
)
if
(
I
sPreemptible
)
In
<
ELFT
>::
RelaDyn
->
addReloc
({
Target
->
TlsOffsetRel
,
In
<
ELFT
>::
Got
,
In
<
ELFT
>::
RelaDyn
->
addReloc
({
Target
->
TlsOffsetRel
,
In
<
ELFT
>::
Got
,
OffsetOff
,
false
,
&
Body
,
0
});
OffsetOff
,
false
,
&
Body
,
0
});
else
else
...
@@ -208,7 +209,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
...
@@ -208,7 +209,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
// Global-Dynamic relocs can be relaxed to Initial-Exec or Local-Exec
// Global-Dynamic relocs can be relaxed to Initial-Exec or Local-Exec
// depending on the symbol being locally defined or not.
// depending on the symbol being locally defined or not.
if
(
i
sPreemptible
(
Body
,
Type
)
)
{
if
(
I
sPreemptible
)
{
C
.
Relocations
.
push_back
(
C
.
Relocations
.
push_back
(
{
Target
->
adjustRelaxExpr
(
Type
,
nullptr
,
R_RELAX_TLS_GD_TO_IE
),
Type
,
{
Target
->
adjustRelaxExpr
(
Type
,
nullptr
,
R_RELAX_TLS_GD_TO_IE
),
Type
,
Offset
,
Addend
,
&
Body
});
Offset
,
Addend
,
&
Body
});
...
@@ -228,8 +229,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
...
@@ -228,8 +229,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
// Initial-Exec relocs can be relaxed to Local-Exec if the symbol is locally
// Initial-Exec relocs can be relaxed to Local-Exec if the symbol is locally
// defined.
// defined.
if
(
Target
->
isTlsInitialExecRel
(
Type
)
&&
!
Config
->
Shared
&&
if
(
Target
->
isTlsInitialExecRel
(
Type
)
&&
!
Config
->
Shared
&&
!
IsPreemptible
)
{
!
isPreemptible
(
Body
,
Type
))
{
C
.
Relocations
.
push_back
(
C
.
Relocations
.
push_back
(
{
R_RELAX_TLS_IE_TO_LE
,
Type
,
Offset
,
Addend
,
&
Body
});
{
R_RELAX_TLS_IE_TO_LE
,
Type
,
Offset
,
Addend
,
&
Body
});
return
1
;
return
1
;
...
...
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