[PATCH] D117612: [BOLT] Update dynamic relocations from section relocations

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 14:34:53 PST 2022


yota9 created this revision.
yota9 added reviewers: maksfb, rafaelauler, Amir.
Herald added a reviewer: rafauler.
Herald added a subscriber: ayermolo.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 we the total number of them should be equal or less
of old number.

Testing: No special tests is 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.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117612

Files:
  bolt/include/bolt/Core/BinarySection.h
  bolt/include/bolt/Core/Relocation.h
  bolt/include/bolt/Rewrite/RewriteInstance.h
  bolt/lib/Core/Relocation.cpp
  bolt/lib/Rewrite/RewriteInstance.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117612.400993.patch
Type: text/x-patch
Size: 15056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220118/01bf07c1/attachment.bin>


More information about the llvm-commits mailing list