llvm-project/lldb/source
Pavel Labath 1177bc597d ObjectFileELF: permit thread-local sections with overlapping file addresses
Summary:
In an attempt to make file-address-based lookups more predictable, in D55998
we started ignoring sections which would result in file address
overlaps. It turns out this was too aggressive because thread-local
sections typically will have file addresses which apear to overlap
regular data/code. This does not cause a problem at runtime because
thread-local sections are loaded into memory using special logic, but it
can cause problems for lldb when trying to lookup objects by their file
address.

This patch changes ObjectFileELF to permit thread-local sections to
overlap regular ones by essentially giving them a separate address
space. It also makes them more symmetrical to regular sections by
creating container sections from PT_TLS segments.

Simultaneously, the patch changes the regular file address lookup logic
to ignore sections with the thread-specific bit set. I believe this is
what the users looking up file addresses would typically expect, as
looking up thread-local data generally requires more complex logic (e.g.
DWARF has a special opcode for that).

Reviewers: clayborg, jingham, MaskRay

Subscribers: emaste, aprantl, arichardson, lldb-commits

Differential Revision: https://reviews.llvm.org/D65282

llvm-svn: 368010
2019-08-06 10:04:27 +00:00
..
API SymbolVendor: Remove passthrough methods 2019-08-06 09:12:42 +00:00
Breakpoint [Symbol] Use llvm::Expected when getting TypeSystems 2019-07-30 22:12:34 +00:00
Commands SymbolVendor: Remove passthrough methods 2019-08-06 09:12:42 +00:00
Core ObjectFileELF: permit thread-local sections with overlapping file addresses 2019-08-06 10:04:27 +00:00
DataFormatters Revert "[CompilerType] Simplify the interface a bit more.." 2019-08-06 00:42:11 +00:00
Expression [lldb] Move redundant persistent variable counter to ClangPersistentVariables 2019-08-05 12:32:59 +00:00
Host Remove usage of usleep in generic code 2019-08-05 08:23:25 +00:00
Initialization [Reproducers] Include lldb version in the reproducer root 2019-06-13 04:35:22 +00:00
Interpreter Format OptionEnumValueElement (NFC) 2019-08-02 00:18:44 +00:00
Plugins ObjectFileELF: permit thread-local sections with overlapping file addresses 2019-08-06 10:04:27 +00:00
Symbol SymbolVendor: Remove passthrough methods 2019-08-06 09:12:42 +00:00
Target Remove usage of usleep in generic code 2019-08-05 08:23:25 +00:00
Utility Remove unused function 'SetMangledCounterparts' (NFC) 2019-08-06 04:01:58 +00:00
CMakeLists.txt [CMake] Remove Apple-specific version logic. 2019-04-17 18:23:22 +00:00
lldb.cpp [CMake] Remove Apple-specific version logic. 2019-04-17 18:23:22 +00:00