Re: [s390:features 97/98] Unsupported relocation type: 21

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Josh,

On Thu, Feb 22, 2024 at 09:37:27AM -0800, Josh Poimboeuf wrote:
> On Thu, Feb 22, 2024 at 02:42:01PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
> > head:   4a5993287467d2d0401503256dc9d2690c7f2020
> > commit: 778666df60f0d96f215e33e27448de47a2207fb3 [97/98] s390: compile relocatable kernel without -fPIE
> > config: s390-randconfig-002-20231016 (https://download.01.org/0day-ci/archive/20240222/202402221404.T2TGs8El-lkp@xxxxxxxxx/config)
> > compiler: s390-linux-gcc (GCC) 13.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240222/202402221404.T2TGs8El-lkp@xxxxxxxxx/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202402221404.T2TGs8El-lkp@xxxxxxxxx/
> > 
> > All errors (new ones prefixed by >>):
> > 
> > >> Unsupported relocation type: 21
> 
> This is R_390_GOTPCDBL, which I believe can be ignored by the relocs
> tool since it's related to the GOT.
> 
> I'm not able to recreate with my s390 toolchain (12.2.0), but I suspect
> the following fixes it:
> 
> diff --git a/arch/s390/tools/relocs.c b/arch/s390/tools/relocs.c
> index db8bcbf9d8f8..ad3773dc1f95 100644
> --- a/arch/s390/tools/relocs.c
> +++ b/arch/s390/tools/relocs.c
> @@ -276,6 +276,7 @@ static int do_reloc(struct section *sec, Elf_Rel *rel)
>  	case R_390_PC32DBL:
>  	case R_390_PLT32DBL:
>  	case R_390_GOTENT:
> +	case R_390_GOTPCDBL:
>  		break;
>  	case R_390_64:
>  		add_reloc(&relocs64, offset);
> 

We tested the diff above. The "Unsupported relocation type: 21" error
goes away but another "Unsupported relocation type: 28" error appears.
Refer to arch/s390/include/asm/elf.h, seems R_390_GOTOFF64 also needs to
be taken care of.

The original error is as below, which can be reproduced by both gcc-12
and gcc-13 in our tests:

$ wget https://download.01.org/0day-ci/archive/20240222/202402221404.T2TGs8El-lkp@xxxxxxxxx/config -O .config

$ s390-linux-gcc --version
s390-linux-gcc (GCC) 13.2.0
$ make ARCH=s390 CROSS_COMPILE=s390-linux- olddefconfig
$ make -j72 ARCH=s390 CROSS_COMPILE=s390-linux-
...
  RELOCS arch/s390/boot/relocs.S
Unsupported relocation type: 21
make[2]: *** [arch/s390/boot/Makefile:118: arch/s390/boot/relocs.S] Error 1
make[2]: *** Deleting file 'arch/s390/boot/relocs.S'
make[1]: *** [arch/s390/Makefile:142: bzImage] Error 2

After adding "case R_390_GOTPCDBL:":

$ make -j72 ARCH=s390 CROSS_COMPILE=s390-linux-
...
  RELOCS arch/s390/boot/relocs.S
Unsupported relocation type: 28
make[2]: *** [arch/s390/boot/Makefile:118: arch/s390/boot/relocs.S] Error 1
make[2]: *** Deleting file 'arch/s390/boot/relocs.S'

Not sure if R_390_GOTOFF64 can also be ignored as R_390_GOTPCDBL. We
tried this and the bzImage is successfully built:

$ make -j72 ARCH=s390 CROSS_COMPILE=s390-linux-
  HOSTCC  arch/s390/tools/relocs
  CALL    scripts/checksyscalls.sh
  RELOCS arch/s390/boot/relocs.S
  AS      arch/s390/boot/relocs.o
  LD      arch/s390/boot/vmlinux.syms
  DUMPSYMS arch/s390/boot/vmlinux.syms
  OBJCOPY arch/s390/boot/syms.o
  LD      arch/s390/boot/vmlinux
  SECTCMP .boot.data
  SECTCMP .boot.preserved.data
  OBJCOPY arch/s390/boot/bzImage

This is a randconfig build test, and issue can be fixed by ignoring both
R_390_GOTPCDBL and R_390_GOTOFF64, but not sure if this is a complete
fix for build tests on all kinds of configs.

Seems there are several other GOT related constants defined in
arch/s390/include/asm/elf.h. Could you help check if there may be
other ones to be handled together?

Thanks,
Yujie




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux