summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/dotest.py
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-10-08 00:13:59 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-10-08 00:13:59 +0000
commit4bddca306a451f2577ec62dd73c30b5e91a8fb32 (patch)
tree642da293793aff5e87a854b90e46c0b99252bc2c /lldb/packages/Python/lldbsuite/test/dotest.py
parent2e2c93476282990ae6b4845578ced9bf51d43e43 (diff)
downloadbcm5719-llvm-4bddca306a451f2577ec62dd73c30b5e91a8fb32.tar.gz
bcm5719-llvm-4bddca306a451f2577ec62dd73c30b5e91a8fb32.zip
[MachO] Fix symbol merging during symtab parsing.
The symtab parser in ObjectFileMachO has logic to coalesce debug (STAB) and non-debug symbols, based on the address and the symbol name for static (STSYM) and global symbols (GSYM) respectively. It makes the assumption that the debug variant is always encountered first. Rather than creating a second entry in the symbol table for the non-debug symbol, the latter gets merged into the existing debug symbol. This breaks when the linker emits the non-debug symbol first. We'd end up with two entries in the symbol table, each containing part of the information LLDB relies on. Indeed, commenting out the merging logic breaks the test suite spectacularly. This patch solves that problem by always parsing the debug symbols first. This guarantees that the assumption for merging holds. I'm not particularly happy with adding a lambda, but after numerous attempts this is the best solution I could come up with. The symtab parsing logic is pretty complex in that it touches a lot of things. I've experienced first hand that it's very easy to break things. I believe this approach strikes a balance between fixing the issue while limiting the risk of regressions. Differential revision: https://reviews.llvm.org/D68536 llvm-svn: 373994
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud