[lld] r254253 - Fixed potential crash on non-ELF64LE targets.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 29 06:14:20 PST 2015


Author: grimar
Date: Sun Nov 29 08:14:20 2015
New Revision: 254253

URL: http://llvm.org/viewvc/llvm-project?rev=254253&view=rev
Log:
Fixed potential crash on non-ELF64LE targets.
Incorrect template specialization was used (generic ELFT type was expected but platform specific was used).

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=254253&r1=254252&r2=254253&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Sun Nov 29 08:14:20 2015
@@ -811,7 +811,7 @@ lld::elf2::getLocalRelTarget(const Objec
 
   if (Sym->getType() == STT_TLS)
     return (Section->OutSec->getVA() + Section->getOffset(*Sym) + Addend) -
-           Out<ELF64LE>::TlsPhdr->p_vaddr;
+           Out<ELFT>::TlsPhdr->p_vaddr;
 
   // According to the ELF spec reference to a local symbol from outside
   // the group are not allowed. Unfortunately .eh_frame breaks that rule




More information about the llvm-commits mailing list