[PATCH] D143748: [BOLT] Improve dynamic relocations support for CI

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 08:51:37 PST 2023


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

This patch fixes few problems with supporting dynamic relocations in CI.

1. After dynamic relocations and functions were read search for dynamic

relocations located in functions. Currently we expected them only to be
relative and only to be in constant island. Mark islands of such
functions to have dynamic relocations and create CI access symbol on the
relocation offset, so the BD would be created for such place.

2. During function disassemble and handling address reference for

constant island check if the referred external CI has dynamic
relocation. And if it has one we would continue to refer original CI
rather then creating a local copy.

3. After function disassembly stage mark function that has dynamic reloc

in CI as non-simple. We don't want such functions to be optimized, since
such passes as split function would create 2 copies of CI which we
unable to support currently.

4. During updating output values for BF search for BD located in CI and

update their output locations.

5. On dynamic relocation patching stage search for binary data located

on relocation offset. If it was moved use new relocation offset value
rather then an old one.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143748

Files:
  bolt/include/bolt/Core/BinaryFunction.h
  bolt/include/bolt/Rewrite/RewriteInstance.h
  bolt/lib/Core/BinaryContext.cpp
  bolt/lib/Core/BinaryFunction.cpp
  bolt/lib/Rewrite/RewriteInstance.cpp
  bolt/test/AArch64/constant_island_pie_update.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143748.496501.patch
Type: text/x-patch
Size: 10129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230210/1e9b5f2b/attachment.bin>


More information about the llvm-commits mailing list