aboutcode-org / aboutcode-org/elf-inspector

Ignore "fake" symbols

Aberta
#7 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
1
Forks
0
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

These are builtin and related:
This is a small function worked out in go-inspector:
```Python
def is_fake_path(path):
"""
Return True if a ``path`` string is for a fake path injected by the linker or compiler in the binary.
See:
https://github.com/smoofra/elfutils/blob/53b6f190892c738f28840e7481a09c7ee19b6720/src/srcfiles.cxx#L160

For example:
>>> is_fake_symbol("")
True
>>> is_fake_symbol("foo/bar/")
True
>>> is_fake_symbol("")
True
>>> is_fake_symbol("/artificial/asdasdas/adsd")
False
>>> is_fake_symbol("")
False
>>> is_fake_symbol("/sdfsdfsdf/zffd")
Trye

"""
fake_paths = (
#gcc intrinsics
"", "",
# seen in Go and C++
"",
"",
)
return isinstance(path, str) and any(fs in path for fs in fake_paths)
```

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.