xaizek / objdeps (License: Apache-2.0) (since 2020-09-11)
This is a python script that analyzes output of `objdump` to understand connections between object files.
Commit 2fe0dd38619fdb5356f8fdfe116da2fb0073a31d

Count self-imports of symbols separately
Author: xaizek
Author date (UTC): 2020-09-11 10:34
Committer name: xaizek
Committer date (UTC): 2020-09-11 10:34
Parent(s): 147a4faa826b83530038ffecee4aaca96de4c4cf
Signing key: 99DC5E4DB05F6BE2
Tree: 7b00fa7db9fec7deb576a76b4d11f079c94cd809
File Lines added Lines deleted
deps.py 7 2
File deps.py changed (mode: 100755) (index 6483943..bfb0dff)
... ... class function:
74 74 self.importedBy = [] self.importedBy = []
75 75 self._exportCounter = 0 self._exportCounter = 0
76 76 self._importCounter = 0 self._importCounter = 0
77 self._selfImportCounter = 0
77 78 self._mod = None self._mod = None
78 79 def remove(self): def remove(self):
79 80 for mod in self.importedBy: for mod in self.importedBy:
80 81 mod.remImport(self) mod.remImport(self)
81 82 self._mod.remExport(self) self._mod.remExport(self)
82 83 def addImport(self, mod): def addImport(self, mod):
83 self._importCounter += 1
84 if mod == self:
85 self._selfImportCounter += 1
86 else:
87 self._importCounter += 1
84 88 self.importedBy += [mod] self.importedBy += [mod]
85 89 def addExport(self, mod): def addExport(self, mod):
86 90 assert self._mod is None, ("%s: %s & %s" % assert self._mod is None, ("%s: %s & %s" %
 
... ... class function:
92 96 def isSystem(self): def isSystem(self):
93 97 return self._exportCounter == 0 and self._importCounter > 0 return self._exportCounter == 0 and self._importCounter > 0
94 98 def isUnused(self): def isUnused(self):
95 return self._exportCounter > 0 and self._importCounter == 0
99 return self._exportCounter > 0 \
100 and self._importCounter - self._selfImportCounter == 0
96 101 def belongsTo(self, mod): def belongsTo(self, mod):
97 102 return self._mod == mod return self._mod == mod
98 103 def getMod(self): def getMod(self):
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/objdeps

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/objdeps

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master