[PATCH] D159513: [Bolt] fix a relocation bug for R_AARCH64_CALL26

Sinan Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 02:30:38 PDT 2023


sinan added a comment.

In D159513#4645982 <https://reviews.llvm.org/D159513#4645982>, @yota9 wrote:

> One more thing. It seems to be without force-patch the encodeValueAArch64 still would be called, but since functions would be moved to the new text there won't be negative address problem. I don't think there is a better way then using force-funcs so it would fail to patch entries & functions would stay on its current place, but please:
>
> 1. Please write the reason of using force-funcs option in the test, because after some time even I won't remember what I wrote above :)
> 2. Please add checks on llvm-bolt output that func1 and func2 were failed to patch and won't be optimised, since otherwise the test might pass, but the problem won't be checked. Alternatively (maybe even better) please check that in output binary the addresses are func1 < _start < func2. Maybe I would do both since the first option also shows more clearly why force-patch was used, but it's up to you.
>
> Thanks!

your analysis is right. encodeValueAArch64 will be called without force-patch. What this option really does is keep the address order of func1, _start and func2 since func1 and func2 fail to patch entries. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159513/new/

https://reviews.llvm.org/D159513



More information about the llvm-commits mailing list