[Lldb-commits] [PATCH] D63540: Fix lookup of symbols at the same address with no size vs. size

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 25 00:12:36 PDT 2019

labath added a comment.

In D63540#1550858 <https://reviews.llvm.org/D63540#1550858>, @clayborg wrote:

> So I am fine with symbols having zero size being in the symbol table. I would be fine not changing anything in the sorting and leaving some symbols with zero size, we just need to fix:
>   Symbol *Symtab::FindSymbolAtFileAddress(addr_t file_addr);
> To ignore zero sized symbols when it finds them _if_ there is another symbol that has a size for that address. Wouldn't that fix the issue here?

You are assuming here that the symbols have size zero at the time we are performing the lookup. If I understand correctly what is going on, the problem here is that the code munging the symbol table (InitAddressIndexes), will set these symbols to have non-zero size. This is what this patch is trying to avoid.

The reason we are fiddling with the size of the symbols is because there are valid instances of symbols not having a size (usually coming from hand-written assembly, where one just doesn't bother to add the .size directive). However, it certainly seems like we shouldn't be doing that if there is another symbol at the same address, and this symbol has the size set correctly...




More information about the lldb-commits mailing list