[lld] [ELF] Demote symbols in /DISCARD/ discarded sections to Undefined (PR #69295)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 07:56:53 PDT 2023


================
@@ -7,6 +7,11 @@
 
 # ERR: error: {{.*}}.o has an STT_TLS symbol but doesn't have an SHF_TLS section
 
+## As a corner case, when /DISCARD/ is present, demoteLocalSymbolsInDiscardedSections
----------------
smithp35 wrote:

Maybe worth putting a FIXME or TODO here so that if this changes then we don't think that this is required behaviour.

Looking back in the history this error was put in to prevent a crash when a symbol was incorrectly typed, so I think not emitting the error is OK in this case.

I think it is illegal to refer to TLS variables using non-TLS relocations anyway. Perhaps in some future patch we can check that.

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


More information about the llvm-commits mailing list