Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caren Kresse
callgraph
Commits
6ec2a626
Commit
6ec2a626
authored
May 16, 2021
by
Carsten Emde
Browse files
Warn, if a symbol is exported by more than a single ELF file
parent
3edcf88f
Changes
1
Hide whitespace changes
Inline
Side-by-side
generatecypher.py
View file @
6ec2a626
...
...
@@ -302,6 +302,7 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
outputfileopen
.
write
(
"
\n
</nodes>"
)
outputfileopen
.
write
(
"
\n
<edges>"
)
exported_symbols_to_elf
=
{}
# then declare for all the symbols which are exported
for
filename
in
machine_to_binary
[
architecture
][
o
][
endian
][
elfclass
]:
if
notarget
(
filename
,
limitsearch
):
...
...
@@ -340,6 +341,9 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
elif
outputformat
==
'text'
:
outputfileopen
.
write
(
"%s EXPORTS %s"
%
(
filename
,
exp
[
'name'
]))
exportedsymbols
+=
1
if
exp
[
'name'
]
not
in
exported_symbols_to_elf
:
exported_symbols_to_elf
[
exp
[
'name'
]]
=
[]
exported_symbols_to_elf
[
exp
[
'name'
]].
append
(
filename
)
if
exportedsymbols
==
0
and
targets
!=
[]
and
filename
not
in
targets
:
files_without_exports
.
add
(
filename
)
for
l
in
linked_libraries
[
filename
]:
...
...
@@ -350,6 +354,10 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
if
otherfilename
not
in
files_without_exports
:
files_without_exports
.
add
(
otherfilename
)
for
symbol
in
exported_symbols_to_elf
:
if
len
(
exported_symbols_to_elf
[
symbol
])
>
1
:
print
(
"Warning: Symbol '%s' found more than once in %s"
%
(
symbol
,
exported_symbols_to_elf
[
symbol
]))
if
files_without_exports
!=
set
():
print
(
"Warning: Linked but unused files %s found and marked as such"
%
(
files_without_exports
))
...
...
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