[Lldb-commits] [PATCH] D17450: Add support for handling absolute symbols in ELF

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 19 13:51:04 PST 2016

clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

We should probably make it such that if a section has the type eSectionTypeAbsoluteAddress that we do the right thing inside the following functions:



Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2092
@@ -2085,3 +2091,3 @@
         SymbolType symbol_type = eSymbolTypeInvalid;
         Elf64_Half symbol_idx = symbol.st_shndx;
This variable has a really bad name. We should change "symbol_idx" to "section_idx" and make this const:
const Elf64_Half section_idx = symbol.st_shndx;

Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2291
@@ +2290,3 @@
+        if (symbol_section_sp == nullptr && symbol.st_size != 0)
+        {
Shouldn't this just be:

if (!symbol_section_sp && symbol.st_shndx != SHN_UNDEF  && symbol.st_size != 0)

We need to know if a symbol has an address and it only has an address if symbol.st_shndx != SHN_UNDEF. All other section types mean that the symbol actually has an address


More information about the lldb-commits mailing list