s390/kpatch-build: Restrict -mno-pic-data-is-text-relative flag #1492
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
s390 -mno-pic-data-is-text-relative prevents relative addressing between code and data. The cflag option was introduced to avoid PC32 relocation errors when the kpatch text and data segments are placed far apart.
However, since the Linux kernel commit c98d2ecae08f ("s390/mm: Uncouple physical vs virtual address spaces"), the kernel, modules, and data segments remain close to each other, and therefore no longer risk PC32 relocation errors.
Additionally, with the recent kernel commit 04dabb4261c3 ("s390/bug: Implement __WARN_printf()")
git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git for-next branch, it has inline assembly which uses string literals as immediate operands. gcc fails to compile kpatch module when -mno-pic-data-is-text-relative is used.
Therefore, restrict the use of -mno-pic-data-is-text-relative to kernels prior to commit c98d2ecae08f.