Skip to content

Conversation

@sumanthkorikkar
Copy link
Contributor

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.

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.

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant