[all-commits] [llvm/llvm-project] 369899: [BOLT] Always move JTs in jump-table=move

Rafael Auler via All-commits all-commits at lists.llvm.org
Fri Nov 4 13:21:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 369899449226a00f15422a12aacb62dee312c8d5
      https://github.com/llvm/llvm-project/commit/369899449226a00f15422a12aacb62dee312c8d5
  Author: Rafael Auler <rafaelauler at fb.com>
  Date:   2022-11-04 (Fri, 04 Nov 2022)

  Changed paths:
    M bolt/lib/Core/BinaryEmitter.cpp
    A bolt/test/X86/Inputs/jt-pic-linkerscript.ld
    A bolt/test/X86/jump-table-pic-conflict.s

  Log Message:
  -----------
  [BOLT] Always move JTs in jump-table=move

We should always move jump tables when requested. Previously,
we were not moving jump tables of non-simple functions in relocation
mode. That caused a bug detailed in the attached test case: in PIC
jump tables, we force jump tables to be moved, but if they are not
moved because the function is not simple, we could incorrectly update
original entries in .rodata, corrupting it under special circumstances
(see testcase).

Reviewed By: #bolt, maksfb

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




More information about the All-commits mailing list