[all-commits] [llvm/llvm-project] 729d29: [BOLT] Update dynamic relocations from section rel...

Vladislav Khmelevsky via All-commits all-commits at lists.llvm.org
Wed Feb 16 07:41:40 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 729d29e167a553ee1190c310b6a510db8d8731ac
      https://github.com/llvm/llvm-project/commit/729d29e167a553ee1190c310b6a510db8d8731ac
  Author: Vladislav Khmelevsky <Vladislav.Khmelevskyi at huawei.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M bolt/include/bolt/Core/BinarySection.h
    M bolt/include/bolt/Core/Relocation.h
    M bolt/include/bolt/Rewrite/RewriteInstance.h
    M bolt/lib/Core/Relocation.cpp
    M bolt/lib/Rewrite/RewriteInstance.cpp
    A bolt/test/runtime/AArch64/Inputs/runtime_relocs.c
    A bolt/test/runtime/AArch64/Inputs/tls_ld.yaml
    A bolt/test/runtime/AArch64/Inputs/tls_trad.yaml
    A bolt/test/runtime/AArch64/runtime_relocs.c

  Log Message:
  -----------
  [BOLT] Update dynamic relocations from section relocations

This patch changes patchELFAllocatableRelaSections from going through
old relocations sections and update the relocation offsets to emitting
the relocations stored in binary sections. This is needed in case we
would like to remove and add dynamic relocations during BOLT work and it
is used by golang support pass. Note: Currently we emit relocations in
the old sections, so the total number of them should be equal or less
of old number.

Testing: No special tests are neeeded, since this patch does not fix
anything or add new functionality (it only prepares to add). Every
PIC-compiled test binary will use this code and thus become a test.
But just in case the aarch64 dynamic relocations tests were added.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Reviewed By: maksfb

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




More information about the All-commits mailing list