diff options
author | Martin Storsjö <martin@martin.st> | 2020-07-17 23:35:45 +0300 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2020-07-21 16:05:41 +0200 |
commit | bf2f2bffee244318a86fea90a0dfaf9be8a71b8c (patch) | |
tree | 873b4e3aa0d909cf9cd25d3f0e70e92bcecc4613 | |
parent | e05c7e400f3afb9b6ec47d23a46bc68ef906ee77 (diff) | |
download | llvm-bf2f2bffee244318a86fea90a0dfaf9be8a71b8c.zip llvm-bf2f2bffee244318a86fea90a0dfaf9be8a71b8c.tar.gz llvm-bf2f2bffee244318a86fea90a0dfaf9be8a71b8c.tar.bz2 |
[LLDB] [COFF] Fix handling of symbols with more than one aux symbol
Differential Revision: https://reviews.llvm.org/D84070
(cherry picked from commit f07ddbc9c4b66e91aa7a106042512ee903b6b3ba)
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 2 | ||||
-rw-r--r-- | lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index d606b49..dac2c49 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -698,7 +698,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() { if (symbol.naux > 0) { i += symbol.naux; - offset += symbol_size; + offset += symbol.naux * symbol_size; } } } diff --git a/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml b/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml index 1d79e70..9dbc93b 100644 --- a/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml +++ b/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml @@ -1,6 +1,9 @@ # RUN: yaml2obj %s > %t # RUN: lldb-test symbols %t | FileCheck %s +## The .file symbol isn't checked, but is included to test that the symbol +## table iteration handles cases with a symbol with more than one aux symbol. + # CHECK: Type File Address/Value {{.*}} Size Flags Name # CHECK: Code 0x0000000040001000 0x{{[0-9a-f]+}} 0x{{[0-9a-f]+}} entry # CHECK: 0x0000000040002000 0x{{[0-9a-f]+}} 0x{{[0-9a-f]+}} variable @@ -101,6 +104,13 @@ symbols: SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC + - Name: .file + Value: 0 + SectionNumber: -2 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_FILE + File: longfilenameusingtwoauxsymbols - Name: entry Value: 0 SectionNumber: 1 |