summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authorMatt Kopec <Matt.Kopec@intel.com>2013-02-12 18:30:30 +0000
committerMatt Kopec <Matt.Kopec@intel.com>2013-02-12 18:30:30 +0000
commit92dd5cfe044b56e2c8a9382a4b2ae153fe0bd6aa (patch)
treea731137d4e853cbf20ca5d6322ab840cac20ef20 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parentf72d06a9197124a37bcf5d27b80b7f9f64f0a549 (diff)
downloadbcm5719-llvm-92dd5cfe044b56e2c8a9382a4b2ae153fe0bd6aa.tar.gz
bcm5719-llvm-92dd5cfe044b56e2c8a9382a4b2ae153fe0bd6aa.zip
Fix ELF parsing where undefined symbols were being added to the symbol table with the incorrect symbol type.
llvm-svn: 174984
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp56
1 files changed, 30 insertions, 26 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 5500e236998..2cee5c01da9 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -750,37 +750,41 @@ ParseSymbols(Symtab *symtab,
break;
}
- switch (symbol.getType())
+ // If a symbol is undefined do not process it further even if it has a STT type
+ if (symbol_type != eSymbolTypeUndefined)
{
- default:
- case STT_NOTYPE:
- // The symbol's type is not specified.
- break;
+ switch (symbol.getType())
+ {
+ default:
+ case STT_NOTYPE:
+ // The symbol's type is not specified.
+ break;
- case STT_OBJECT:
- // The symbol is associated with a data object, such as a variable,
- // an array, etc.
- symbol_type = eSymbolTypeData;
- break;
+ case STT_OBJECT:
+ // The symbol is associated with a data object, such as a variable,
+ // an array, etc.
+ symbol_type = eSymbolTypeData;
+ break;
- case STT_FUNC:
- // The symbol is associated with a function or other executable code.
- symbol_type = eSymbolTypeCode;
- break;
+ case STT_FUNC:
+ // The symbol is associated with a function or other executable code.
+ symbol_type = eSymbolTypeCode;
+ break;
- case STT_SECTION:
- // The symbol is associated with a section. Symbol table entries of
- // this type exist primarily for relocation and normally have
- // STB_LOCAL binding.
- break;
+ case STT_SECTION:
+ // The symbol is associated with a section. Symbol table entries of
+ // this type exist primarily for relocation and normally have
+ // STB_LOCAL binding.
+ break;
- case STT_FILE:
- // Conventionally, the symbol's name gives the name of the source
- // file associated with the object file. A file symbol has STB_LOCAL
- // binding, its section index is SHN_ABS, and it precedes the other
- // STB_LOCAL symbols for the file, if it is present.
- symbol_type = eSymbolTypeObjectFile;
- break;
+ case STT_FILE:
+ // Conventionally, the symbol's name gives the name of the source
+ // file associated with the object file. A file symbol has STB_LOCAL
+ // binding, its section index is SHN_ABS, and it precedes the other
+ // STB_LOCAL symbols for the file, if it is present.
+ symbol_type = eSymbolTypeObjectFile;
+ break;
+ }
}
if (symbol_type == eSymbolTypeInvalid)
OpenPOWER on IntegriCloud