Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CFI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Open Source Software
CFI
Commits
96f3ab0f
Commit
96f3ab0f
authored
8 years ago
by
jdh8d
Browse files
Options
Downloads
Patches
Plain Diff
Update for STARS to run after selective_cfi.
parent
88d8967d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scfi_instr.cpp
+17
-6
17 additions, 6 deletions
scfi_instr.cpp
with
17 additions
and
6 deletions
scfi_instr.cpp
+
17
−
6
View file @
96f3ab0f
...
...
@@ -449,11 +449,20 @@ void mov_reloc(Instruction_t* from, Instruction_t* to, string type )
static
void
move_relocs
(
Instruction_t
*
from
,
Instruction_t
*
to
)
{
for
_each
(
from
->
GetRelocations
().
begin
()
,
from
->
GetRelocations
().
end
()
,
[
&
to
](
Relocation_t
*
reloc
)
for
(
auto
it
=
from
->
GetRelocations
().
begin
()
;
it
!=
from
->
GetRelocations
().
end
()
;
)
{
to
->
GetRelocations
().
insert
(
reloc
);
});
from
->
GetRelocations
().
clear
();
auto
current
=
it
++
;
Relocation_t
*
reloc
=*
current
;
if
(
reloc
->
GetType
()
==
"fix_call_fallthrough"
)
{
// don't move it.
}
else
{
to
->
GetRelocations
().
insert
(
reloc
);
from
->
GetRelocations
().
erase
(
current
);
}
}
}
void
SCFI_Instrument
::
AddJumpCFI
(
Instruction_t
*
insn
)
...
...
@@ -482,6 +491,8 @@ void SCFI_Instrument::AddJumpCFI(Instruction_t* insn)
createNewRelocation
(
firp
,
after
,
"slow_cfi_path"
,
0
);
after
->
SetFallthrough
(
NULL
);
after
->
SetTarget
(
after
);
after
->
SetIBTargets
(
NULL
);
// lose information about ib targets.
insn
->
SetIBTargets
(
NULL
);
// lose information about ib targets.
return
;
#else
...
...
@@ -509,7 +520,7 @@ void SCFI_Instrument::AddCallCFIWithExeNonce(Instruction_t* insn)
// jmp slow
string
pushbits
=
change_to_push
(
insn
);
Instruction_t
*
stub
=
addNewDatabits
(
firp
,
NULL
,
pushbits
);
stub
->
SetComment
(
insn
->
GetComment
()
+
" cfi stu
f
"
);
stub
->
SetComment
(
insn
->
GetComment
()
+
" cfi stu
b
"
);
string
jmpBits
=
getJumpDataBits
();
...
...
@@ -529,7 +540,7 @@ void SCFI_Instrument::AddCallCFIWithExeNonce(Instruction_t* insn)
insn
->
SetTarget
(
stub
);
insn
->
SetDataBits
(
call_bits
);
insn
->
SetComment
(
"Direct call to cfi stub"
);
insn
->
SetIBTargets
(
NULL
);
// lose info about branch targets.
}
...
...
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