[Lldb-commits] [PATCH] D65282: ObjectFileELF: permit thread-local sections with overlapping file addresses

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 25 07:39:01 PDT 2019


labath created this revision.
labath added reviewers: clayborg, jingham.
Herald added subscribers: MaskRay, arichardson, aprantl, emaste.
Herald added a reviewer: espindola.

In an attempt to make file-address-based lookups more predictable, in D55998 <https://reviews.llvm.org/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).


https://reviews.llvm.org/D65282

Files:
  lit/Modules/ELF/PT_LOAD-overlap-PT_TLS.yaml
  source/Core/Section.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65282.211749.patch
Type: text/x-patch
Size: 7635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190725/29258f51/attachment.bin>


More information about the lldb-commits mailing list