]> www.infradead.org Git - users/dwmw2/linux.git/commit
s390/tools: handle rela R_390_GOTPCDBL/R_390_GOTOFF64
authorSumanth Korikkar <sumanthk@linux.ibm.com>
Thu, 7 Mar 2024 08:46:11 +0000 (09:46 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Mar 2024 16:02:05 +0000 (17:02 +0100)
commitfa9e3139e6c5ac756e1ab2a6c7eca99eb684a2fe
tree267c8dc97f4ab7aefac21ba8f9a58b3a3a3449b4
parentcb0cd4ee11142339f2d47eef6db274290b7a482d
s390/tools: handle rela R_390_GOTPCDBL/R_390_GOTOFF64

lkp test robot reported unhandled relocation type: R_390_GOTPCDBL, when
kernel is built with -fno-PIE. relocs tool reads vmlinux and handles
absolute relocations.  PC relative relocs doesn't need adjustment.

Also, the R_390_GOTPCDBL/R_390_GOTOFF64 relocations are present
currently only when KASAN is enabled.

The following program can create a R_390_GOTPCDBL/R_390_GOTOFF64 reloc
(with fPIE/fPIC).

void funcb(int *b) {
  *b = *b + 100;
}

void gen_gotoff(void)
{
  int b = 10;
  funcb (&b);
}

gcc -c sample.c -fPIC -fsanitize=kernel-address --param asan-stack=1

The above example (built with -fPIC) was linked to one of the
built-in.a (built with -fno-PIE) and checked for correctness with kaslr
enabled. Both the relocs turns out relative and can be skipped.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402221404.T2TGs8El-lkp@intel.com/
Fixes: 55dc65b46023 ("s390: add relocs tool")
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/tools/relocs.c