aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Omair Javaid <omair.javaid@linaro.org>2019-11-12 18:48:32 +0500
committerMuhammad Omair Javaid <omair.javaid@linaro.org>2019-11-13 03:15:42 +0500
commit5ab44f3ec15f2be1e244c1b565381e0011985365 (patch)
treee1340a65bd6b6ce104f83e97dda3d404e3fdcb47
parent7a140f4a293e05a1047bc39c805fba5878b6fa3a (diff)
downloadllvm-5ab44f3ec15f2be1e244c1b565381e0011985365.zip
llvm-5ab44f3ec15f2be1e244c1b565381e0011985365.tar.gz
llvm-5ab44f3ec15f2be1e244c1b565381e0011985365.tar.bz2
Revert "Fix lookup of symbols at the same address with no size vs. size"
This reverts commit 3f594ed1686b44138bee245c708773e526643aaf. This change has cause LLDB expression evaluation to fail on Arm Linux. Differential Revision: https://reviews.llvm.org/D63540 (cherry picked from commit a6c40f56aed1556a80867209b6846f7eedc4dc78)
-rw-r--r--lldb/lit/SymbolFile/Inputs/sizeless-symbol.s8
-rw-r--r--lldb/lit/SymbolFile/sizeless-symbol.test14
-rw-r--r--lldb/source/Symbol/Symtab.cpp10
3 files changed, 2 insertions, 30 deletions
diff --git a/lldb/lit/SymbolFile/Inputs/sizeless-symbol.s b/lldb/lit/SymbolFile/Inputs/sizeless-symbol.s
deleted file mode 100644
index ac08ddd..0000000
--- a/lldb/lit/SymbolFile/Inputs/sizeless-symbol.s
+++ /dev/null
@@ -1,8 +0,0 @@
- .text
- .byte 0
-sizeless:
-sizeful:
- .byte 0
- .byte 0
-sizeend:
- .size sizeful, sizeend - sizeful
diff --git a/lldb/lit/SymbolFile/sizeless-symbol.test b/lldb/lit/SymbolFile/sizeless-symbol.test
deleted file mode 100644
index 1459d6a..0000000
--- a/lldb/lit/SymbolFile/sizeless-symbol.test
+++ /dev/null
@@ -1,14 +0,0 @@
-# Some targets do not have the .size directive.
-# RUN: %clang -target x86_64-unknown-unknown-elf %S/Inputs/sizeless-symbol.s -c -o %t.o
-# RUN: %lldb %t.o -s %s -o quit | FileCheck %s
-
-image lookup --address 1
-# CHECK: Summary: sizeless-symbol.test.tmp.o`sizeful
-image lookup --address 2
-# CHECK: Summary: sizeless-symbol.test.tmp.o`sizeful + 1
-image dump symtab
-# CHECK: Index UserID DSX Type File Address/Value Load Address Size Flags Name
-# CHECK-NEXT:------- ------ --- --------------- ------------------ ------------------ ------------------ ---------- ----------------------------------
-# CHECK-NEXT:[ 0] 1 Code 0x0000000000000003 0x0000000000000000 0x00000000 sizeend
-# CHECK-NEXT:[ 1] 2 Code 0x0000000000000001 0x0000000000000002 0x00000000 sizeful
-# CHECK-NEXT:[ 2] 3 Code 0x0000000000000001 0x0000000000000000 0x00000000 sizeless
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 29c390e..5203eba 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -896,14 +896,8 @@ void Symtab::InitAddressIndexes() {
for (size_t i = 0; i < num_entries; i++) {
FileRangeToIndexMap::Entry *entry =
m_file_addr_to_index.GetMutableEntryAtIndex(i);
- if (entry->GetByteSize() > 0)
- continue;
- addr_t curr_base_addr = entry->GetRangeBase();
- // Symbols with non-zero size will show after zero-sized symbols on the
- // same address. So do not set size of a non-last zero-sized symbol.
- if (i == num_entries - 1 ||
- m_file_addr_to_index.GetMutableEntryAtIndex(i + 1)
- ->GetRangeBase() != curr_base_addr) {
+ if (entry->GetByteSize() == 0) {
+ addr_t curr_base_addr = entry->GetRangeBase();
const RangeVector<addr_t, addr_t>::Entry *containing_section =
section_ranges.FindEntryThatContains(curr_base_addr);