Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
900 stars 204 forks source link

Missing TLS symbols in armv7 binary. #4668

Closed lwerdna closed 11 months ago

lwerdna commented 11 months ago

Version and Platform (required): 3.6

Bug Description: Certain symbols don't show up in the symbols list.

Steps To Reproduce: Open the attached binary: libaaa.so.zip

Symbols "var0" and "var1" are missing from the symbol list.

Expected Behavior: Symbols "var0" and "var1" should show in the symbol list.

Extra Info:

These symbols are of type 6 (TLS). So is "var2" but I think since its not associated with a section (st_shndx==0) it is made into an external and does show up:

Elf32_Sym "var0" (index:24)
  st_name=0x61 "var0"
  st_value=0x0
  st_size=0x4
  st_info bind:1(GLOBAL) type:6(TLS)
  st_other=0x0
  st_shndx=0xE

Elf32_Sym "var1" (index:57)
  st_name=0x15F "var1"
  st_value=0x4
  st_size=0x4
  st_info bind:0(LOCAL) type:6(TLS)
  st_other=0x0
  st_shndx=0xE

Symbol "var2" is also TLS, but since its st_shndx is 0, I think Binja creates it as an external.

lwerdna commented 11 months ago

Fixed in branch tls-reloc-work: https://github.com/Vector35/view-elf/commit/6a7885d8a22b5f64cbbf229450b1357a2f445ddb

That will be in put into dev when this related issue is closed: https://github.com/Vector35/binaryninja-api/issues/3979

The symbol UI by default shows only functions. You must enable data variables being shown:

image