linux-stable/arch/s390/tools
Sumanth Korikkar fa9e3139e6 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: 55dc65b460 ("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>
2024-03-07 17:02:05 +01:00
..
.gitignore s390: add relocs tool 2024-02-20 14:37:33 +01:00
Makefile s390: add relocs tool 2024-02-20 14:37:33 +01:00
gcc-thunk-extern.sh s390/nospec: add an option to use thunk-extern 2022-03-10 15:58:17 +01:00
gen_facilities.c s390/als: add vector facility to z13 architecture level set 2023-12-11 14:33:07 +01:00
gen_opcode_table.c s390/tools: fix gcc 8 stringop-truncation warnings 2018-07-02 11:25:05 +02:00
opcodes.txt s390/disassembler: update opcode table 2021-12-16 19:58:07 +01:00
relocs.c s390/tools: handle rela R_390_GOTPCDBL/R_390_GOTOFF64 2024-03-07 17:02:05 +01:00