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

Paschalis Mpeis via All-commits all-commits at lists.llvm.org
Thu Mar 27 05:48:05 PDT 2025


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

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

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


  Commit: 7c8f6604a4e90aa353638fba8f3f88543b019a79
      https://github.com/llvm/llvm-project/commit/7c8f6604a4e90aa353638fba8f3f88543b019a79
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-03-26 (Wed, 26 Mar 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: 0693d739ea467bf048edd4821728a1b5e9c3ab4d
      https://github.com/llvm/llvm-project/commit/0693d739ea467bf048edd4821728a1b5e9c3ab4d
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-03-26 (Wed, 26 Mar 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: b4e906c1d0cd386d5ebefc02aaf0d370d82ffde4
      https://github.com/llvm/llvm-project/commit/b4e906c1d0cd386d5ebefc02aaf0d370d82ffde4
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2025-03-26 (Wed, 26 Mar 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


Compare: https://github.com/llvm/llvm-project/compare/d46158c9b560...b4e906c1d0cd

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