Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
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
Container Registry
Model registry
Operate
Environments
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
Zipr Toolchain
Commits
c0b3066c
Commit
c0b3066c
authored
6 years ago
by
Matthew McGill
Browse files
Options
Downloads
Patches
Plain Diff
gnu.version fix but still code duplication
Former-commit-id: 38b0768ef4dad221621820b8dc60e619c12eee70
parent
287e6677
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/selective_cfi/scfi_instr.cpp
+7
-0
7 additions, 0 deletions
tools/selective_cfi/scfi_instr.cpp
with
7 additions
and
0 deletions
tools/selective_cfi/scfi_instr.cpp
+
7
−
0
View file @
c0b3066c
...
...
@@ -1284,6 +1284,9 @@ void SCFI_Instrument::add_got_entry(const std::string& name)
auto
relaplt_scoop
=
find_scoop
(
firp
,
".rela.dyn coalesced w/.rela.plt"
);
auto
relplt_scoop
=
find_scoop
(
firp
,
".rel.dyn coalesced w/.rel.plt"
);
auto
relscoop
=
relaplt_scoop
!=
NULL
?
relaplt_scoop
:
relplt_scoop
;
auto
gnu_version_scoop
=
find_scoop
(
firp
,
".gnu.version"
);
assert
(
gnu_version_scoop
);
assert
(
gnu_version_scoop
->
getStart
()
->
getVirtualOffset
()
==
0
);
// add 0-init'd pointer to table
string
new_got_entry_str
(
ptrsize
,
0
);
// zero-init a pointer-sized string
...
...
@@ -1319,6 +1322,10 @@ void SCFI_Instrument::add_got_entry(const std::string& name)
string
dl_sym_str
((
const
char
*
)
&
dl_sym
,
sizeof
(
T_Elf_Sym
));
unsigned
int
dl_pos
=
add_to_scoop
(
dl_sym_str
,
dynsym_scoop
);
// update the gnu.version section so that the new symbol has a version.
const
auto
new_version_str
=
string
(
"
\0\0
"
,
2
);
// \0\0 means *local*, as in, don't index the gnu.verneeded array.
add_to_scoop
(
new_version_str
,
gnu_version_scoop
);
// find the rela count. can't insert before that.
int
rela_count
=
0
;
for
(
int
i
=
0
;
i
+
sizeof
(
T_Elf_Dyn
)
<
dynamic_scoop
->
getSize
();
i
+=
sizeof
(
T_Elf_Dyn
))
...
...
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