[all-commits] [llvm/llvm-project] 138b9f: [JITLink][ELF] PCRel32GOTLoad relocations are reso...

Stefan Gränitz via All-commits all-commits at lists.llvm.org
Sat Oct 24 05:56:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 138b9f1928454a6096bb928195bacb7ccd46fd00
      https://github.com/llvm/llvm-project/commit/138b9f1928454a6096bb928195bacb7ccd46fd00
  Author: Stefan Gränitz <stefan.graenitz at gmail.com>
  Date:   2020-10-24 (Sat, 24 Oct 2020)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp

  Log Message:
  -----------
  [JITLink][ELF] PCRel32GOTLoad relocations are resolved like regular PCRel32 ones

The difference is that the former are indirect and go to the GOT while the latter go to the target directly. This info can be used to relax indirect ones that don't need the GOT (because the target is in range). We check for this optimization beforehand. For formal correctness and to avoid confusion, we should only change the relocation kind if we actually apply the relaxation.


  Commit: e9955b0843cc1e5876430f3f051494d4197419f3
      https://github.com/llvm/llvm-project/commit/e9955b0843cc1e5876430f3f051494d4197419f3
  Author: Stefan Gränitz <stefan.graenitz at gmail.com>
  Date:   2020-10-24 (Sat, 24 Oct 2020)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
    A llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_common.s

  Log Message:
  -----------
  [jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON

Symbols with special section index SHN_COMMON (0xfff2) haven't been handled so far and caused an invalid section error.

This is a more or less straightforward use of the code commented out at the end of the function. I checked with the ELF spec, that the symbol value gives the alignment.

Reviewed By: lhames

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


Compare: https://github.com/llvm/llvm-project/compare/b481e00bf4de...e9955b0843cc


More information about the All-commits mailing list