You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On FreeBSD powerpc64 and powerpc64le kernels panic when copyin/copyout symbols are called by external loadable kernel modules (like pfsync) after change https://reviews.freebsd.org/rG47a57144af25a7bd768b29272d50a36fdf2874ba where the IFUNC copyin/copyout functions are in a struct of function pointers.
While debugging LLD I found that the symbols get HAS_DIRECT_RELOC set and the type is changed from STT_GNU_IFUNC to STT_FUNC. A workaround is wrap the calls in a local function (see workaround code in https://reviews.freebsd.org/D36234).
The following tentative also makes a good binary, but it's incorrect and may cause other problems: https://reviews.llvm.org/D133745
See https://maskray.me/blog/2021-01-18-gnu-indirect-function#address-significance STT_GNU_IFUNC has to be converted to STT_FUNC in this case as satisfy pointer equality. I think FreeBSD has a bug somewhere that incorrectly uses non-GOT-generating non-PLT-generating relocation somewhere. The issue should be discussed on the FreeBSD side.
On FreeBSD powerpc64 and powerpc64le kernels panic when copyin/copyout symbols are called by external loadable kernel modules (like pfsync) after change https://reviews.freebsd.org/rG47a57144af25a7bd768b29272d50a36fdf2874ba where the IFUNC copyin/copyout functions are in a struct of function pointers.
While debugging LLD I found that the symbols get
HAS_DIRECT_RELOCset and the type is changed fromSTT_GNU_IFUNCtoSTT_FUNC. A workaround is wrap the calls in a local function (see workaround code in https://reviews.freebsd.org/D36234).The following tentative also makes a good binary, but it's incorrect and may cause other problems: https://reviews.llvm.org/D133745
You can download LLD reproduce tar from: https://people.freebsd.org/~alfredo/tmp/llvm-freebsd-ppc64-kernel-copyout-ifunc.tar.xz
With
readelf -a kernel.full | grep -w copyouton a good binary you should see two entries of type IFUNC while FUNC on the bad binaries.Thanks!
The text was updated successfully, but these errors were encountered: