Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1872,45 +1872,66 @@ } } - ArchSpec arch; + + + int64_t symbol_value_offset = 0; uint32_t additional_flags = 0; - if (GetArchitecture(arch) && - arch.GetMachine() == llvm::Triple::arm) + ArchSpec arch; + if (GetArchitecture(arch)) { - // ELF symbol tables may contain some mapping symbols. They provide - // information about the underlying data. There are three of them - // currently defined: - // $a[.]* - marks an ARM instruction sequence - // $t[.]* - marks a THUMB instruction sequence - // $d[.]* - 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; + // ELF symbol tables may contain some mapping symbols. They + // provide information about the underlying data. These symbols + // interfere with normal debugger operations and we don't need + // them. We can drop them here. + if (arch.GetMachine() == llvm::Triple::arm) + { + // There are three mapping symbol defined on arm: + // $a[.]* - marks an ARM instruction sequence + // $t[.]* - marks a THUMB instruction sequence + // $d[.]* - marks a data item sequence (e.g. lit pool) + 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; + } + else if (arch.GetMachine() == llvm::Triple::aarch64) + { + // There are two mapping symbol defined on aarch64: + // $x[.]* - marks an A64 instruction sequence + // $d[.]* - marks a data item sequence (e.g. lit pool) + static const llvm::StringRef g_aarch64elf_a64_marker("$x"); + static const llvm::StringRef g_aarch64elf_data_marker("$d"); + llvm::StringRef symbol_name_ref(symbol_name); + + if (symbol_name && + (symbol_name_ref.startswith(g_aarch64elf_a64_marker) || + symbol_name_ref.startswith(g_aarch64elf_data_marker))) + continue; + } - // THUMB functions have the lower bit of their address set. Fixup - // the actual address and mark the symbol as THUMB. - if (symbol_type == eSymbolTypeCode && symbol.st_value & 1) + if (arch.GetMachine() == llvm::Triple::arm) { - // Substracting 1 from the address effectively unsets - // the low order bit, which results in the address - // actually pointing to the beginning of the symbol. - // This delta will be used below in conjuction with - // symbol.st_value to produce the final symbol_value - // that we store in the symtab. - symbol_value_offset = -1; - additional_flags = ARM_ELF_SYM_IS_THUMB; + // THUMB functions have the lower bit of their address set. Fixup + // the actual address and mark the symbol as THUMB. + if (symbol_type == eSymbolTypeCode && symbol.st_value & 1) + { + // Substracting 1 from the address effectively unsets + // the low order bit, which results in the address + // actually pointing to the beginning of the symbol. + // This delta will be used below in conjuction with + // symbol.st_value to produce the final symbol_value + // that we store in the symtab. + symbol_value_offset = -1; + additional_flags = ARM_ELF_SYM_IS_THUMB; + } } }