[all-commits] [llvm/llvm-project] 303370: [LLD] [COFF] Mark the symbol _tls_used as a GC roo...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Nov 7 01:49:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 303370e87166305248122a03c9913fde02156f99
      https://github.com/llvm/llvm-project/commit/303370e87166305248122a03c9913fde02156f99
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
    M lld/COFF/Driver.cpp
    A lld/test/COFF/tls-used-gc.s

  Log Message:
  -----------
  [LLD] [COFF] Mark the symbol _tls_used as a GC root (#71336)

This is necessary if the object file containing _tls_used is built with
-fdata-sections; if this symbol is present, lld is going to include
references to it in the PE header, in the TLS_TABLE data directory.

Therefore, treat the symbol as a GC root, i.e. retain it (and whatever
other symbols the section chunk references) when doing doing GC
(/opt:ref), if the symbol is present.




More information about the All-commits mailing list