In order to support kpatch on s390x architecture, we'd like to have the -mpic-data-is-text-relative feature backported to RHEL7. Quick background of how kpatch works: kpatch patches code on a per-function basis and relies on ftrace for function redirection from old to new funcs. The patched binary code containing the new functions is placed in a kernel module, and kpatch manually applies relocations to the new code at module load time. On s390x, things become interesting when we stick patched code for vmlinux in a kernel module. One obstacle we've run into is when the compiled code uses R_390_PC32DBL relocations, which utilize 32-bit relative displacements. However, kernel modules are placed at the tail end of the kernel address space, rendering these relocations non-functional, since the displacement to vmlinux symbols on the other end of the address space is larger than what can fit in a 32-bit field. To work around this issue, we worked upstream with Martin Schwidefsky and Andreas Krebbel to add 9852c8ae7856 ("S/390: New option -mpic-data-is-text-relative"). That option ensures that data references are not relative, but rather via GOT. The change seems pretty small and hopefully easy to backport to RHEL7's gcc.
Related tests passed with gcc-4.8.5-36.el7.s390x. VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3016