[all-commits] [llvm/llvm-project] 01d2a0: [ELF] Fix a null pointer dereference when relocati...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Apr 21 15:40:29 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 01d2a01e79d3d83f18cf3e54c2bf55bba523b77a
      https://github.com/llvm/llvm-project/commit/01d2a01e79d3d83f18cf3e54c2bf55bba523b77a
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-04-21 (Tue, 21 Apr 2020)

  Changed paths:
    M lld/ELF/InputSection.cpp
    R lld/test/ELF/Inputs/tls-in-archive.s
    R lld/test/ELF/tls-in-archive.s
    A lld/test/ELF/tls-le-weak-undef.s
    R lld/test/ELF/tls-weak-undef.s
    M lld/test/ELF/x86-64-tls-le-undef.s

  Log Message:
  -----------
  [ELF] Fix a null pointer dereference when relocating a Local-Exec TLS relocation for a lazy symbol

If there is no SHF_TLS section, there will be no PT_TLS and Out::tlsPhdr may be a nullptr.
If the symbol referenced by an R_TLS is lazy, we should treat the symbol as undefined.

Also reorganize tls-in-archive.s and tls-weak-undef.s . They do not test what they intended to test.




More information about the All-commits mailing list