[all-commits] [llvm/llvm-project] e2f1a9: [BOLT][AArch64] Handle IFUNCS properly (#71104)

Vladislav Khmelevsky via All-commits all-commits at lists.llvm.org
Tue Nov 7 23:41:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2f1a95f2a41e86e7bdac71bb0e61b91b1ccf2f5
      https://github.com/llvm/llvm-project/commit/e2f1a95f2a41e86e7bdac71bb0e61b91b1ccf2f5
  Author: Vladislav Khmelevsky <och95 at yandex.ru>
  Date:   2023-11-08 (Wed, 08 Nov 2023)

  Changed paths:
    M bolt/include/bolt/Core/Relocation.h
    M bolt/lib/Rewrite/RewriteInstance.cpp
    A bolt/test/AArch64/Inputs/iplt.ld
    A bolt/test/AArch64/ifunc.c
    M bolt/test/runtime/iplt.c

  Log Message:
  -----------
  [BOLT][AArch64] Handle IFUNCS properly (#71104)

Currently we were testing only the binaries compiled with O0, which
results in indirect call to the IFUNC trampoline and the trampoline has
associated IFUNC symbol with it. Compile with O3 results in direct
calling the IFUNC trampoline and no symbols are associated with it, the
IFUNC symbol address becomes the same as IFUNC resolver address. Since
no symbol was associated the BF was not created before PLT analyze and
be the algorithm we're going to analyze target relocation. As we're
expecting the JUMP relocation we're also expecting the associated symbol
with it to be presented. But for IFUNC relocation the IRELATIVE
relocation is used and no symbol is associated with it, the addend value
is pointing on the target symbol, so we need to find BF using it and use
it's symbol in this situation. Currently this is checked only for
AArch64 platform, so I've limited it in code to use this logic only for
this platform, although I wouldn't be surprised if other platforms needs
to activate this logic too.




More information about the All-commits mailing list