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

Fangrui Song via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 25 23:13:59 PDT 2019


MaskRay added a comment.

> 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.

Yes :) This can happen with .tbss (SHT_NOBITS) overlapping another section (usually .fini_array, but .got and .data are also possible).



================
Comment at: lit/Modules/ELF/PT_LOAD-overlap-PT_TLS.yaml:68
+    Flags:           [ SHF_ALLOC, SHF_WRITE, SHF_TLS ]
+    Address:         0x1010
+    AddressAlign:    0x4
----------------
> .tbss 0x1000 NOBITS
>
> .tdata 0x1010 PROGBITS

Move .tdata before .tbss (0xff0) to make the example more realistic?

.tdata has a larger address than .tbss. I think this is impossible in ld.bfd, but you can make .tbss go before .tdata with a broken lld linker script.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65282/new/

https://reviews.llvm.org/D65282





More information about the lldb-commits mailing list