diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2014-09-15 16:27:44 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2014-09-15 16:27:44 +0000 |
commit | 1a08866aab6fd54b2fbe75f89f4a42c5f820e65a (patch) | |
tree | f49e07388c132f4ef48e384d3093597956e16d3a /lldb/source | |
parent | 36d791023e124f9b2d06224be0d5c2a5ca8e5055 (diff) | |
download | bcm5719-llvm-1a08866aab6fd54b2fbe75f89f4a42c5f820e65a.tar.gz bcm5719-llvm-1a08866aab6fd54b2fbe75f89f4a42c5f820e65a.zip |
Handle ARM ELF symbols properly: skip $t* and $a* symbols in ObjectFileELF.
ELF objects contain marker symbols to differentiate between ARM and
THUMB functions. Instead of storing them internally and having garbage
show up when symbols are searched for by the user, we can just skip them
and not store them at all, as we never actually need them.
Change by Stephane Sezer.
Tested:
Ubuntu 14.04 x86_64
MacOSX 10.9.4 x86_64
llvm-svn: 217782
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d86aee78947..2541b2c628a 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1746,6 +1746,32 @@ ObjectFileELF::ParseSymbols (Symtab *symtab, } } + ArchSpec arch; + + if (GetArchitecture(arch) && + arch.GetMachine() == llvm::Triple::arm) + { + // ELF symbol tables may contain some mapping symbols. They provide + // information about the underlying data. There are three of them + // currently defined: + // $a[.<any>]* - marks an ARM instruction sequence + // $t[.<any>]* - marks a THUMB instruction sequence + // $d[.<any>]* - marks a data item sequence (e.g. lit pool) + // These symbols interfere with normal debugger operations and we + // don't need them. We can drop them here. + + static const llvm::StringRef g_armelf_arm_marker("$a"); + static const llvm::StringRef g_armelf_thumb_marker("$t"); + static const llvm::StringRef g_armelf_data_marker("$d"); + llvm::StringRef symbol_name_ref(symbol_name); + + if (symbol_name && + (symbol_name_ref.startswith(g_armelf_arm_marker) || + symbol_name_ref.startswith(g_armelf_thumb_marker) || + symbol_name_ref.startswith(g_armelf_data_marker))) + continue; + } + // If the symbol section we've found has no data (SHT_NOBITS), then check the module section // list. This can happen if we're parsing the debug file and it has no .text section, for example. if (symbol_section_sp && (symbol_section_sp->GetFileSize() == 0)) |