[lld] r307983 - ELF: Reword a somewhat misleading error message.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 17:22:46 PDT 2017


Author: pcc
Date: Thu Jul 13 17:22:46 2017
New Revision: 307983

URL: http://llvm.org/viewvc/llvm-project?rev=307983&view=rev
Log:
ELF: Reword a somewhat misleading error message.

PT_TLS is a type of program header, so we wouldn't expect to see
one in an object file. This error should probably be referring to
the fact that we didn't see a section with the flag SHF_TLS, which
would normally cause us to create a PT_TLS program header.

Differential Revision: https://reviews.llvm.org/D35395

Modified:
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/test/ELF/invalid/tls-symbol.s

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=307983&r1=307982&r2=307983&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Thu Jul 13 17:22:46 2017
@@ -94,7 +94,7 @@ static uint64_t getSymVA(const SymbolBod
     if (D.isTls() && !Config->Relocatable) {
       if (!Out::TlsPhdr)
         fatal(toString(D.File) +
-              " has a STT_TLS symbol but doesn't have a PT_TLS section");
+              " has an STT_TLS symbol but doesn't have an SHF_TLS section");
       return VA - Out::TlsPhdr->p_vaddr;
     }
     return VA;

Modified: lld/trunk/test/ELF/invalid/tls-symbol.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/tls-symbol.s?rev=307983&r1=307982&r2=307983&view=diff
==============================================================================
--- lld/trunk/test/ELF/invalid/tls-symbol.s (original)
+++ lld/trunk/test/ELF/invalid/tls-symbol.s Thu Jul 13 17:22:46 2017
@@ -1,5 +1,5 @@
 # REQUIRES: x86
 
-## The test file contains a STT_TLS symbol but has no TLS section.
+## The test file contains an STT_TLS symbol but has no TLS section.
 # RUN: not ld.lld %S/Inputs/tls-symbol.elf -o %t 2>&1 | FileCheck %s
-# CHECK: has a STT_TLS symbol but doesn't have a PT_TLS section
+# CHECK: has an STT_TLS symbol but doesn't have an SHF_TLS section




More information about the llvm-commits mailing list