[PATCH] D107208: [ELF] Make dot in .tbss correct and drop threadBssOffset

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 19:22:19 PDT 2021


MaskRay created this revision.
MaskRay added reviewers: grimar, peter.smith.
Herald added subscribers: arichardson, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Multiple SHF_TLS SHT_NOBITS output sections are user error.

That said, `threadBssOffset` implements limited support for consecutive SHF_TLS
SHT_NOBITS sections. (SHF_TLS SHT_PROGBITS following a SHF_TLS SHT_NOBITS can be
incorrect.) The code makes `.` incorrect in an output section description of an
SHF_TLS SHT_NOBITS section.
(https://lists.llvm.org/pipermail/llvm-dev/2021-July/151974.html)

GNU ld restores the address after an SHF_TLS SHT_NOBITS section, so consecutive
SHF_TLS SHT_NOBITS sections will have conflicting address ranges. This patch
drops `threadBssOffset` and makes `.` correct.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107208

Files:
  lld/ELF/LinkerScript.cpp
  lld/test/ELF/linkerscript/multiple-tbss.s
  lld/test/ELF/linkerscript/tbss.s
  lld/test/ELF/tls.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107208.363251.patch
Type: text/x-patch
Size: 5715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210731/1bbdfb28/attachment.bin>


More information about the llvm-commits mailing list