[Lldb-commits] [lldb] [lldb] Fix a bug for PT_TLS segments getting loaded when they shouldn't. (PR #98432)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 11 02:53:04 PDT 2024


================
@@ -1,8 +1,25 @@
 # Overlapping PT_LOAD and PT_TLS segments should be able to exist side by side.
 
+# When an ELF file contains both PT_LOAD and PT_TLS segmentsq where the PT_TLS
+# segment has the same p_vaddr and p_paddr as a PT_LOAD segment, this
+# was causing LLDB, when loading a ELF object file at an address, to overwrite
+# the section load address for a PT_LOAD that shares the same p_vaddr value in
+# the section load list's addr to section map for this code. This test ensures
+# that no PT_TLS segments get loaded and can't interfere with real segments we
+# need to resolved as all access to thread specific memory is only done via
+# DWARF location expressions. We also don't have any code that loads any thread
+# specific segments at a different address for different threads, so there is
+# no reason currently to try and load thread specific segments.
+
 # RUN: yaml2obj %s -o %t
 # RUN: lldb-test object-file %t | FileCheck %s
-# RUN: %lldb %t -o "image lookup -a 0x1000" -b | FileCheck --check-prefix=LOOKUP %s
+# RUN: %lldb %t -b \
+# RUN:       -o "image lookup -a 0x1000" \
+# RUN:       -o "target modules load --file %t --slide 0" \
+# RUN:       -o "image lookup -a 0x1000" \
+# RUN:       -o "target dump section-load-list" \
+# RUN:       | FileCheck --check-prefix=LOOKUP %s
----------------
DavidSpickett wrote:

Would be clearer if you put this command after the CHECK lines.

https://github.com/llvm/llvm-project/pull/98432


More information about the lldb-commits mailing list