[all-commits] [llvm/llvm-project] 4f1589: [BOLT] Add pass to fix ambiguous memory references

Rafael Auler via All-commits all-commits at lists.llvm.org
Wed Oct 12 18:40:26 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f158995b9cddae392bfb5989af8c83101ae0789
      https://github.com/llvm/llvm-project/commit/4f158995b9cddae392bfb5989af8c83101ae0789
  Author: Rafael Auler <rafaelauler at fb.com>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    A bolt/include/bolt/Passes/ValidateMemRefs.h
    M bolt/lib/Core/BinaryEmitter.cpp
    M bolt/lib/Passes/CMakeLists.txt
    A bolt/lib/Passes/ValidateMemRefs.cpp
    M bolt/lib/Rewrite/BinaryPassManager.cpp
    A bolt/test/runtime/X86/jt-symbol-disambiguation-2.s
    A bolt/test/runtime/X86/jt-symbol-disambiguation.s

  Log Message:
  -----------
  [BOLT] Add pass to fix ambiguous memory references

This adds a round of checks to memory references, looking for
incorrect references to jump table objects. Fix them by replacing the
jump table reference with another object reference + offset.

This solves bugs related to regular data references in code
accidentally being bound to a jump table, and this reference being
updated to a new (incorrect) location because we moved this jump
table.

Fixes #55004

Reviewed By: #bolt, maksfb

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




More information about the All-commits mailing list