[PATCH] D133745: [ELF] Relocations: amends c8d9d0000b2f72b50729bfdc7bbb9dd3e9ecd6a0
Alfredo Dal'Ava JĂșnior via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 12 21:49:09 PDT 2022
adalava added a comment.
In D133745#3785479 <https://reviews.llvm.org/D133745#3785479>, @MaskRay wrote:
> This is incorrect. `HAS_DIRECT_RELOC` is properly not named clearly but it intends to refer to just STT_GNU_IFUNC symbols.
> Changing the comparison will break a lot of non-preemptible ifunc tests.
@MaskRay, I don't understand, the commit c8d9d0000b2f72b50729bfdc7bbb9dd3e9ecd6a0 <https://reviews.llvm.org/rGc8d9d0000b2f72b50729bfdc7bbb9dd3e9ecd6a0> message says that it will "set hasDirectReloc only if not ifunc", but the change seems to do the opposite, that's why I'm proposing the amend change (and because it fixes the FreeBSD copyin/copyout symbol).
The issue I'm pursuing started after https://reviews.freebsd.org/rG47a57144af25a7bd768b29272d50a36fdf2874ba, where the IFUNC copyin/copyout is called thought a struct of function pointers. In LLD I found that the symbols get HAS_DIRECT_RELOC set and the type is changed from STT_GNU_IFUNC to STT_FUNC, then kernel modules crash when try to call them. It can be workarounded by creating a local wrapper function that just calls the function intended (code in https://reviews.freebsd.org/D36234). Do you have an idea of what else is missing on LLD?
I had no success creating an small code that reproduces it, but I can share the lld's reproducer for the kernel. Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133745/new/
https://reviews.llvm.org/D133745
More information about the llvm-commits
mailing list