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
326bb62e
Commit
326bb62e
authored
6 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
attributes
Former-commit-id: d140d13ace16fcc514c121784f576d1ab29de473
parent
2ad8c74d
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
tools/rida/rida.cpp
+25
-3
25 additions, 3 deletions
tools/rida/rida.cpp
with
25 additions
and
3 deletions
tools/rida/rida.cpp
+
25
−
3
View file @
326bb62e
...
...
@@ -90,6 +90,14 @@ class CreateFunctions_t
template
<
class
T_Sym
>
void
nameFunctions
()
{
// do symbol names.
parseSyms
<
T_Sym
>
(
".dynsym"
,
".dynstr"
);
parseSyms
<
T_Sym
>
(
".symtab"
,
".strtab"
);
auto
namedFunctions
=
0U
;
auto
unnamedFunctions
=
0U
;
auto
functions
=
0U
;
// set default names
for
(
const
auto
&
func
:
sccs
)
{
...
...
@@ -97,13 +105,23 @@ class CreateFunctions_t
const
auto
first_range
=*
(
func
.
begin
());
const
auto
startAddr
=
first_range
.
first
;
const
auto
name
=
string
()
+
"sub_"
+
to_string
(
startAddr
);
functions
++
;
if
(
funcNames
[
func
]
==
""
)
// destructive test OK, next line sets if empty.
{
unnamedFunctions
++
;
funcNames
[
func
]
=
name
;
}
else
{
namedFunctions
++
;
}
}
cout
<<
"#ATTRIBUTE functions="
<<
dec
<<
functions
<<
endl
;
cout
<<
"#ATTRIBUTE named_functions="
<<
dec
<<
namedFunctions
<<
endl
;
cout
<<
"#ATTRIBUTE uunamed_functions="
<<
dec
<<
unnamedFunctions
<<
endl
;
// do symbol names.
parseSyms
<
T_Sym
>
(
".dynsym"
,
".dynstr"
);
parseSyms
<
T_Sym
>
(
".symtab"
,
".strtab"
);
}
template
<
class
T_Sym
>
...
...
@@ -307,6 +325,7 @@ class CreateFunctions_t
addRange
(
i
+
6
,
plt_entry_size
-
plt_entry_size_first_part
);
addName
(
i
,
dynsymEntryIndex
++
);
}
cout
<<
"#ATTRIBUTE plt_entries="
<<
dec
<<
dynsymEntryIndex
<<
endl
;
// deal with gotPlt Section.
...
...
@@ -318,11 +337,14 @@ class CreateFunctions_t
const
auto
gotPltEntrySize
=
8
;
const
auto
gotPltRangeSize
=
6
;
const
auto
gotPltStartAddr
=
gotPltSec
->
get_address
();
auto
gotpltEntries
=
0U
;
for
(
auto
i
=
0U
;
i
+
gotPltRangeSize
<
(
size_t
)
gotPltSec
->
get_size
();
i
+=
gotPltEntrySize
)
{
addRange
(
gotPltStartAddr
+
i
,
gotPltRangeSize
);
gotpltEntries
++
;
}
cout
<<
"#ATTRIBUTE gotplt_entries="
<<
dec
<<
gotpltEntries
<<
endl
;
}
...
...
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