Skip to content

Commit fa9e313

Browse files
sumanthkorikkarhcahca
authored andcommitted
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 55dc65b ("s390: add relocs tool") Signed-off-by: Sumanth Korikkar <[email protected]> Acked-by: Vasily Gorbik <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent cb0cd4e commit fa9e313

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/s390/tools/relocs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ static int do_reloc(struct section *sec, Elf_Rel *rel)
276276
case R_390_PC32DBL:
277277
case R_390_PLT32DBL:
278278
case R_390_GOTENT:
279+
case R_390_GOTPCDBL:
280+
case R_390_GOTOFF64:
279281
break;
280282
case R_390_64:
281283
add_reloc(&relocs64, offset);

0 commit comments

Comments
 (0)