[all-commits] [llvm/llvm-project] 1d5050: [ELF][MIPS] Don't emit dynamic relocations for PIE...

Jessica Clarke via All-commits all-commits at lists.llvm.org
Tue Apr 27 11:05:18 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d505016efa29ce1e9b11baf8ab2d7950e9bdcc7
      https://github.com/llvm/llvm-project/commit/1d505016efa29ce1e9b11baf8ab2d7950e9bdcc7
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2021-04-27 (Tue, 27 Apr 2021)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp
    M lld/test/ELF/mips-tls-64.s
    M lld/test/ELF/mips-tls.s

  Log Message:
  -----------
  [ELF][MIPS] Don't emit dynamic relocations for PIE non-preemptible TLS

Whilst not wrong (unless using static PIE where the relocations are
likely not implemented by the runtime), this is inefficient, as the TLS
module indices and offsets are independent of the executable's load
address.

Reviewed By: MaskRay, atanasyan

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


  Commit: 7fefd032cb260f96191089c9d817c61276d8bf66
      https://github.com/llvm/llvm-project/commit/7fefd032cb260f96191089c9d817c61276d8bf66
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2021-04-27 (Tue, 27 Apr 2021)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp
    M lld/test/ELF/mips-tls-64.s
    M lld/test/ELF/mips-tls.s

  Log Message:
  -----------
  [ELF][MIPS] Emit dynamic relocations for PIC non-preemptible static TLS

This is the same problem as 127176e59eb9, but for static TLS rather than
dynamic TLS. Although we know the symbol will be the one in our own TLS
segment, and thus the offset of it within that, we don't know where in
the static TLS block our data will be allocated and thus we must emit a
dynamic relocation for this case.

Reviewed By: MaskRay, atanasyan

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


Compare: https://github.com/llvm/llvm-project/compare/6a2e29851738...7fefd032cb26


More information about the All-commits mailing list