Skip to content

Unrelated symbol value when compiling with -c -g #6857

Open
@sinitax

Description

@sinitax

Version and Platform (required):

  • Binary Ninja Version: 5.0.7290-stable & 5.1.7484-dev
  • Edition: Commercial
  • OS: Arch Linux
  • OS Version: 2025-05-01
  • CPU Architecture: x64

Bug Description:
For at least one symbol, the value it references is replaced by a completely different string.

Steps To Reproduce:
Reproducible by compiling with -c -g on gcc or clang, tested with gcc 15.1.1 and clang 19.1.7.
Source-code for first screenshot: int main(void) {}
Source-code for second screenshot: void abc(void) {}; int main(void) {}

Expected Behavior:
The symbol does not reference an unrelated string.

Screenshots/Video Recording:

Image

Image

Binary:

First screenshot: main.zip

Second screenshot: main.zip

Additional Information:
In the sample screenshots the symbol value was replaced with the contents of the .comment section, but this is not always the case. In another instance the string value was unsigned int, a binaryninja internal string.

Typically the symbol affected is that of the first defined function. When this function's name is <4 bytes long, the value in the Symbols view is correct, but in the Linear view it is the unrelated value.

Without knowing how things are implemented under the hood it looks like some sort of misindex into a string table, potentially with the index value being erroneously set to 0.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions