[all-commits] [llvm/llvm-project] a6dbcb: BOLT asserts on out-of-range pending relocs

Paschalis Mpeis via All-commits all-commits at lists.llvm.org
Thu Apr 3 08:45:21 PDT 2025


  Branch: refs/heads/users/paschalis-mpeis/skip-oob-pending-relocs
  Home:   https://github.com/llvm/llvm-project
  Commit: a6dbcb860407921c4fac7c25930d917eb3408ed3
      https://github.com/llvm/llvm-project/commit/a6dbcb860407921c4fac7c25930d917eb3408ed3
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-04-03 (Thu, 03 Apr 2025)

  Changed paths:
    M bolt/unittests/Core/BinaryContext.cpp

  Log Message:
  -----------
  BOLT asserts on out-of-range pending relocs


  Commit: e69ce41c8c2e32341850d12b9af7cd6df675d9e0
      https://github.com/llvm/llvm-project/commit/e69ce41c8c2e32341850d12b9af7cd6df675d9e0
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-04-03 (Thu, 03 Apr 2025)

  Changed paths:
    M bolt/include/bolt/Core/BinarySection.h
    M bolt/include/bolt/Core/Relocation.h
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Core/BinarySection.cpp
    M bolt/lib/Core/Relocation.cpp
    M bolt/unittests/Core/BinaryContext.cpp

  Log Message:
  -----------
  [BOLT] Skip flushing optional out-of-range pending relocs

When a pending relocation is created it is also marked whether it is
optional or not. It can be optional when such relocation is added as
part of an optimization (i.e., `scanExternalRefs`).

When bolt tries to `flushPendingRelocations`, it safely skips any
optional relocations that cannot be encoded.

Background:
BOLT, as part of scanExternalRefs, identifies external references from
calls and creates some pending relocations for them. Those when flushed
will update references to point to the optimized functions. This
optimization can be disabled using `--no-scan`.

BOLT can assert if any of these pending relocations cannot be encoded.

This patch does not disable this optimization but instead selectively
applies it given that a pending relocation is optional.


  Commit: 1388020545aa80fcac52a39fec64a66fc1fe9589
      https://github.com/llvm/llvm-project/commit/1388020545aa80fcac52a39fec64a66fc1fe9589
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-04-03 (Thu, 03 Apr 2025)

  Changed paths:
    M bolt/lib/Core/BinarySection.cpp
    M bolt/unittests/Core/BinaryContext.cpp
    M bolt/unittests/Core/CMakeLists.txt

  Log Message:
  -----------
  Ensure PatchEntries runs

Allow skipping pending relocations only when `-force-patch` is set.
Otherwise, exit with a relevant message.


  Commit: f0b43e9417c0f097b5bbd33842a3f49856a9d9db
      https://github.com/llvm/llvm-project/commit/f0b43e9417c0f097b5bbd33842a3f49856a9d9db
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-04-03 (Thu, 03 Apr 2025)

  Changed paths:
    M bolt/include/bolt/Core/BinarySection.h
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Core/BinarySection.cpp
    M bolt/unittests/Core/BinaryContext.cpp

  Log Message:
  -----------
  Addressing reviewers


  Commit: 1bb9af5d128c7491e494a0c2dc63365c340275d1
      https://github.com/llvm/llvm-project/commit/1bb9af5d128c7491e494a0c2dc63365c340275d1
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-04-03 (Thu, 03 Apr 2025)

  Changed paths:
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Core/BinarySection.cpp
    M bolt/unittests/Core/BinaryContext.cpp

  Log Message:
  -----------
  Addressing reviewers (2)


Compare: https://github.com/llvm/llvm-project/compare/87988061fc43...1bb9af5d128c

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list