[Lldb-commits] [PATCH] D16186: Unconditionally accept symbol sizes from .dynsym

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 14 10:06:58 PST 2016

tberghammer added a comment.

Yes it will prevent the artificial size calculation for symbols with 0 size in .dynsym. I think all function and data symbols should have a valid size so I am not sure why we have this symbol size calculation in the first place but I assume it is to work around some old compiler bug.

You can end up with a 0 size symbol if you specify a symbol in assembly without specifying it's type and size (found it in some android framework code).

  .global foo
  <any data or code>

The unwinder treat symbols with 0 size the same way as it treats with valid size. The difference is that it treats an address differently if we have a symbol for it and if we don't have a symbol for it. In the first case it calculates the unwind info for the given function while in the second case it tries to find unwind information fitting for the given address.

The current implementation with extending the length of the symbol have a few problem:

- We will display the wrong function name to the user in the backtrace what is annoying (worse then not showing a function name)
- If we end up with an incorrect symbol name then we will use the unwind information for that symbol what won't be valid at the location where the code is currently stopped


More information about the lldb-commits mailing list