mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-07 16:12:47 +00:00
scripts: Strip compiler suffixes in result scripts
This can be explicitly disabled with -x/--no-strip in the relevant scripts, but stripping by default seems to be more useful for composing results in higher-level scripts. It's better for the result names to be consistent, even if they don't match the .o symbols exactly. Note some scripts are unaffected: - cov.py - gcov doesn't seem to have an option for getting the unstripped symbols, so we only output the stripped names. - structs.py - structs.py deals with struct names, which are notably not symbols.
This commit is contained in:
@@ -453,6 +453,7 @@ def collect_dwarf_info(obj_path, tags=None, *,
|
||||
|
||||
def collect_code(obj_paths, *,
|
||||
everything=False,
|
||||
no_strip=False,
|
||||
**args):
|
||||
results = []
|
||||
for obj_path in obj_paths:
|
||||
@@ -493,7 +494,12 @@ def collect_code(obj_paths, *,
|
||||
if not everything and sym.name.startswith('__'):
|
||||
continue
|
||||
|
||||
results.append(CodeResult(file, sym.name, sym.size))
|
||||
# strip compiler suffixes
|
||||
name = sym.name
|
||||
if not no_strip:
|
||||
name = name.split('.', 1)[0]
|
||||
|
||||
results.append(CodeResult(file, name, sym.size))
|
||||
|
||||
return results
|
||||
|
||||
@@ -1188,6 +1194,10 @@ if __name__ == "__main__":
|
||||
'--everything',
|
||||
action='store_true',
|
||||
help="Include builtin and libc specific symbols.")
|
||||
parser.add_argument(
|
||||
'-x', '--no-strip',
|
||||
action='store_true',
|
||||
help="Don't strip compiler optimization suffixes from symbols.")
|
||||
parser.add_argument(
|
||||
'--objdump-path',
|
||||
type=lambda x: x.split(),
|
||||
|
||||
Reference in New Issue
Block a user