linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
@ 2020-05-20  2:28 kbuild test robot
  2020-05-20 15:53 ` Arvind Sankar
  0 siblings, 1 reply; 9+ messages in thread
From: kbuild test robot @ 2020-05-20  2:28 UTC (permalink / raw)
  To: Arvind Sankar; +Cc: kbuild-all, clang-built-linux, linux-efi, Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
config: x86_64-defconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29396 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20  2:28 [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol '' kbuild test robot
@ 2020-05-20 15:53 ` Arvind Sankar
  2020-05-20 16:14   ` Ard Biesheuvel
  0 siblings, 1 reply; 9+ messages in thread
From: Arvind Sankar @ 2020-05-20 15:53 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Arvind Sankar, kbuild-all, clang-built-linux, linux-efi, Ard Biesheuvel

On Wed, May 20, 2020 at 10:28:13AM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
> head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
> commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
> config: x86_64-defconfig (attached as .config)
> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install x86_64 cross compiling tool for clang build
>         # apt-get install binutils-x86-64-linux-gnu
>         git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
> 
> >> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Clang folk, is anything actually wrong here? This seems to result from
use of unreachable() annotation, which generates these
.discard.unreachable sections apparently to help objtool.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 15:53 ` Arvind Sankar
@ 2020-05-20 16:14   ` Ard Biesheuvel
  2020-05-20 17:34     ` Fangrui Song
  0 siblings, 1 reply; 9+ messages in thread
From: Ard Biesheuvel @ 2020-05-20 16:14 UTC (permalink / raw)
  To: Arvind Sankar; +Cc: kbuild test robot, kbuild-all, clang-built-linux, linux-efi

On Wed, 20 May 2020 at 17:53, Arvind Sankar <nivedita@alum.mit.edu> wrote:
>
> On Wed, May 20, 2020 at 10:28:13AM +0800, kbuild test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
> > head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
> > commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
> > config: x86_64-defconfig (attached as .config)
> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
> > reproduce:
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # install x86_64 cross compiling tool for clang build
> >         # apt-get install binutils-x86-64-linux-gnu
> >         git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kbuild test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> >
> > >> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
> Clang folk, is anything actually wrong here? This seems to result from
> use of unreachable() annotation, which generates these
> .discard.unreachable sections apparently to help objtool.
>

This came up before, and IIRC, it has already been fixed, only this
branch is based on v5.7-rc2.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 16:14   ` Ard Biesheuvel
@ 2020-05-20 17:34     ` Fangrui Song
  2020-05-20 17:39       ` Arvind Sankar
  0 siblings, 1 reply; 9+ messages in thread
From: Fangrui Song @ 2020-05-20 17:34 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Arvind Sankar, kbuild test robot, kbuild-all, clang-built-linux,
	linux-efi

On 2020-05-20, Ard Biesheuvel wrote:
>On Wed, 20 May 2020 at 17:53, Arvind Sankar <nivedita@alum.mit.edu> wrote:
>>
>> On Wed, May 20, 2020 at 10:28:13AM +0800, kbuild test robot wrote:
>> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
>> > head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
>> > commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
>> > config: x86_64-defconfig (attached as .config)
>> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
>> > reproduce:
>> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> >         chmod +x ~/bin/make.cross
>> >         # install x86_64 cross compiling tool for clang build
>> >         # apt-get install binutils-x86-64-linux-gnu
>> >         git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
>> >         # save the attached .config to linux build tree
>> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>> >
>> > If you fix the issue, kindly add following tag as appropriate
>> > Reported-by: kbuild test robot <lkp@intel.com>
>> >
>> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> >
>> > >> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
>> >
>> > ---
>> > 0-DAY CI Kernel Test Service, Intel Corporation
>> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>>
>> Clang folk, is anything actually wrong here? This seems to result from
>> use of unreachable() annotation, which generates these
>> .discard.unreachable sections apparently to help objtool.
>>
>
>This came up before, and IIRC, it has already been fixed, only this
>branch is based on v5.7-rc2.

LLD reports the diagnostic because a PC-relative relocation referencing a
SHF_ALLOC section from a non-SHF_ALLOC section (.discard.unreachable) cannot be
reasonably represented. A non-SHF_ALLOC section is not part of the memory image, thus conceptually
the distance between a non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at linktime.
This is actually a nice diagnostic which has caught a number of issues.

% readelf -Wr drivers/firmware/efi/libstub/vsprintf.stub.o
..
Relocation section '.rela.discard.unreachable' at offset 0xe38 contains 1 entry:
     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
0000000000000000  0000000600000002 R_X86_64_PC32          0000000000000000 .text + ac0

---

The linker command line is:

% ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/kernel_info.o arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/kaslr_64.o arch/x86/boot/compressed/mem_encrypt.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o drivers/firmware/efi/libstub/lib.a arch/x86/boot/compressed/efi_thunk_64.o -o arch/x86/boot/compressed/vmlinux
ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''

arch/x86/boot/compressed/vmlinux has an output section .discard.unreachable , which is likely desired.

Note that arch/x86/kernel/vmlinux.lds.S has an output section description /DISCARD/ : { ... *(.discard.*) ... },
but arch/x86/boot/compressed/vmlinux doesn't.

We can let arch/x86/boot/compressed/vmlinux reuse the /DISCARD/ to fix the issue.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 17:34     ` Fangrui Song
@ 2020-05-20 17:39       ` Arvind Sankar
  2020-05-20 17:41         ` Arvind Sankar
  2020-05-20 18:26         ` Fangrui Song
  0 siblings, 2 replies; 9+ messages in thread
From: Arvind Sankar @ 2020-05-20 17:39 UTC (permalink / raw)
  To: Fangrui Song
  Cc: Ard Biesheuvel, Arvind Sankar, kbuild test robot, kbuild-all,
	clang-built-linux, linux-efi

On Wed, May 20, 2020 at 10:34:25AM -0700, Fangrui Song wrote:
> On 2020-05-20, Ard Biesheuvel wrote:
> >On Wed, 20 May 2020 at 17:53, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >>
> >> On Wed, May 20, 2020 at 10:28:13AM +0800, kbuild test robot wrote:
> >> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
> >> > head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
> >> > commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
> >> > config: x86_64-defconfig (attached as .config)
> >> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
> >> > reproduce:
> >> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >> >         chmod +x ~/bin/make.cross
> >> >         # install x86_64 cross compiling tool for clang build
> >> >         # apt-get install binutils-x86-64-linux-gnu
> >> >         git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
> >> >         # save the attached .config to linux build tree
> >> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
> >> >
> >> > If you fix the issue, kindly add following tag as appropriate
> >> > Reported-by: kbuild test robot <lkp@intel.com>
> >> >
> >> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> >> >
> >> > >> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> >> >
> >> > ---
> >> > 0-DAY CI Kernel Test Service, Intel Corporation
> >> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> >>
> >> Clang folk, is anything actually wrong here? This seems to result from
> >> use of unreachable() annotation, which generates these
> >> .discard.unreachable sections apparently to help objtool.
> >>
> >
> >This came up before, and IIRC, it has already been fixed, only this
> >branch is based on v5.7-rc2.
> 
> LLD reports the diagnostic because a PC-relative relocation referencing a
> SHF_ALLOC section from a non-SHF_ALLOC section (.discard.unreachable) cannot be
> reasonably represented. A non-SHF_ALLOC section is not part of the memory image, thus conceptually
> the distance between a non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at linktime.
> This is actually a nice diagnostic which has caught a number of issues.
> 
> % readelf -Wr drivers/firmware/efi/libstub/vsprintf.stub.o
> ..
> Relocation section '.rela.discard.unreachable' at offset 0xe38 contains 1 entry:
>      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
> 0000000000000000  0000000600000002 R_X86_64_PC32          0000000000000000 .text + ac0
> 
> ---
> 
> The linker command line is:
> 
> % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/kernel_info.o arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/kaslr_64.o arch/x86/boot/compressed/mem_encrypt.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o drivers/firmware/efi/libstub/lib.a arch/x86/boot/compressed/efi_thunk_64.o -o arch/x86/boot/compressed/vmlinux
> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> 
> arch/x86/boot/compressed/vmlinux has an output section .discard.unreachable , which is likely desired.

You mean /not/ desired, right?

> 
> Note that arch/x86/kernel/vmlinux.lds.S has an output section description /DISCARD/ : { ... *(.discard.*) ... },
> but arch/x86/boot/compressed/vmlinux doesn't.
> 
> We can let arch/x86/boot/compressed/vmlinux reuse the /DISCARD/ to fix the issue.

Yep.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 17:39       ` Arvind Sankar
@ 2020-05-20 17:41         ` Arvind Sankar
  2020-05-20 17:56           ` Nick Desaulniers
  2020-05-20 18:26         ` Fangrui Song
  1 sibling, 1 reply; 9+ messages in thread
From: Arvind Sankar @ 2020-05-20 17:41 UTC (permalink / raw)
  To: Arvind Sankar
  Cc: Fangrui Song, Ard Biesheuvel, kbuild test robot, kbuild-all,
	clang-built-linux, linux-efi

On Wed, May 20, 2020 at 01:39:26PM -0400, Arvind Sankar wrote:
> On Wed, May 20, 2020 at 10:34:25AM -0700, Fangrui Song wrote:
> > On 2020-05-20, Ard Biesheuvel wrote:
> > >On Wed, 20 May 2020 at 17:53, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> > >>
> > >> On Wed, May 20, 2020 at 10:28:13AM +0800, kbuild test robot wrote:
> > >> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
> > >> > head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
> > >> > commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
> > >> > config: x86_64-defconfig (attached as .config)
> > >> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
> > >> > reproduce:
> > >> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >> >         chmod +x ~/bin/make.cross
> > >> >         # install x86_64 cross compiling tool for clang build
> > >> >         # apt-get install binutils-x86-64-linux-gnu
> > >> >         git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
> > >> >         # save the attached .config to linux build tree
> > >> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
> > >> >
> > >> > If you fix the issue, kindly add following tag as appropriate
> > >> > Reported-by: kbuild test robot <lkp@intel.com>
> > >> >
> > >> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> > >> >
> > >> > >> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> > >> >
> > >> > ---
> > >> > 0-DAY CI Kernel Test Service, Intel Corporation
> > >> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> > >>
> > >> Clang folk, is anything actually wrong here? This seems to result from
> > >> use of unreachable() annotation, which generates these
> > >> .discard.unreachable sections apparently to help objtool.
> > >>
> > >
> > >This came up before, and IIRC, it has already been fixed, only this
> > >branch is based on v5.7-rc2.
> > 
> > LLD reports the diagnostic because a PC-relative relocation referencing a
> > SHF_ALLOC section from a non-SHF_ALLOC section (.discard.unreachable) cannot be
> > reasonably represented. A non-SHF_ALLOC section is not part of the memory image, thus conceptually
> > the distance between a non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at linktime.
> > This is actually a nice diagnostic which has caught a number of issues.
> > 
> > % readelf -Wr drivers/firmware/efi/libstub/vsprintf.stub.o
> > ..
> > Relocation section '.rela.discard.unreachable' at offset 0xe38 contains 1 entry:
> >      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
> > 0000000000000000  0000000600000002 R_X86_64_PC32          0000000000000000 .text + ac0
> > 
> > ---
> > 
> > The linker command line is:
> > 
> > % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/kernel_info.o arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/kaslr_64.o arch/x86/boot/compressed/mem_encrypt.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o drivers/firmware/efi/libstub/lib.a arch/x86/boot/compressed/efi_thunk_64.o -o arch/x86/boot/compressed/vmlinux
> > ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> > 
> > arch/x86/boot/compressed/vmlinux has an output section .discard.unreachable , which is likely desired.
> 
> You mean /not/ desired, right?
> 
> > 
> > Note that arch/x86/kernel/vmlinux.lds.S has an output section description /DISCARD/ : { ... *(.discard.*) ... },
> > but arch/x86/boot/compressed/vmlinux doesn't.
> > 
> > We can let arch/x86/boot/compressed/vmlinux reuse the /DISCARD/ to fix the issue.
> 
> Yep.

As an aside, how does one (should I) get onto kbuild-all? It keeps
bouncing me as a non-list member currently.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 17:41         ` Arvind Sankar
@ 2020-05-20 17:56           ` Nick Desaulniers
  2020-05-21  0:23             ` Philip Li
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-05-20 17:56 UTC (permalink / raw)
  To: Arvind Sankar
  Cc: Fangrui Song, Ard Biesheuvel, kbuild test robot, kbuild-all,
	clang-built-linux, linux-efi, Philip Li, Chen Rong

On Wed, May 20, 2020 at 10:41 AM Arvind Sankar <nivedita@alum.mit.edu> wrote:
>
> As an aside, how does one (should I) get onto kbuild-all? It keeps
> bouncing me as a non-list member currently.

Philip Li <philip.li@intel.com>
Chen Rong <rong.a.chen@intel.com>
are the two folks I always reference for 0day bot related questions. I
haven't seen bounces, but I also don't recall subscribing to any
related mailing lists.  Maybe I was added to one?
-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 17:39       ` Arvind Sankar
  2020-05-20 17:41         ` Arvind Sankar
@ 2020-05-20 18:26         ` Fangrui Song
  1 sibling, 0 replies; 9+ messages in thread
From: Fangrui Song @ 2020-05-20 18:26 UTC (permalink / raw)
  To: Arvind Sankar
  Cc: Ard Biesheuvel, kbuild test robot, kbuild-all, clang-built-linux,
	linux-efi


On 2020-05-20, Arvind Sankar wrote:
>On Wed, May 20, 2020 at 10:34:25AM -0700, Fangrui Song wrote:
>> On 2020-05-20, Ard Biesheuvel wrote:
>> >On Wed, 20 May 2020 at 17:53, Arvind Sankar <nivedita@alum.mit.edu> wrote:
>> >>
>> >> On Wed, May 20, 2020 at 10:28:13AM +0800, kbuild test robot wrote:
>> >> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
>> >> > head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
>> >> > commit: ce5e3f909fc0ed67e58367b9c56a54c20a51080b [22/40] efi/printf: Add 64-bit and 8-bit integer support
>> >> > config: x86_64-defconfig (attached as .config)
>> >> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
>> >> > reproduce:
>> >> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> >> >         chmod +x ~/bin/make.cross
>> >> >         # install x86_64 cross compiling tool for clang build
>> >> >         # apt-get install binutils-x86-64-linux-gnu
>> >> >         git checkout ce5e3f909fc0ed67e58367b9c56a54c20a51080b
>> >> >         # save the attached .config to linux build tree
>> >> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>> >> >
>> >> > If you fix the issue, kindly add following tag as appropriate
>> >> > Reported-by: kbuild test robot <lkp@intel.com>
>> >> >
>> >> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> >> >
>> >> > >> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
>> >> >
>> >> > ---
>> >> > 0-DAY CI Kernel Test Service, Intel Corporation
>> >> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>> >>
>> >> Clang folk, is anything actually wrong here? This seems to result from
>> >> use of unreachable() annotation, which generates these
>> >> .discard.unreachable sections apparently to help objtool.
>> >>
>> >
>> >This came up before, and IIRC, it has already been fixed, only this
>> >branch is based on v5.7-rc2.
>>
>> LLD reports the diagnostic because a PC-relative relocation referencing a
>> SHF_ALLOC section from a non-SHF_ALLOC section (.discard.unreachable) cannot be
>> reasonably represented. A non-SHF_ALLOC section is not part of the memory image, thus conceptually
>> the distance between a non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at linktime.
>> This is actually a nice diagnostic which has caught a number of issues.
>>
>> % readelf -Wr drivers/firmware/efi/libstub/vsprintf.stub.o
>> ..
>> Relocation section '.rela.discard.unreachable' at offset 0xe38 contains 1 entry:
>>      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
>> 0000000000000000  0000000600000002 R_X86_64_PC32          0000000000000000 .text + ac0
>>
>> ---
>>
>> The linker command line is:
>>
>> % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/kernel_info.o arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/kaslr_64.o arch/x86/boot/compressed/mem_encrypt.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o drivers/firmware/efi/libstub/lib.a arch/x86/boot/compressed/efi_thunk_64.o -o arch/x86/boot/compressed/vmlinux
>> ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
>>
>> arch/x86/boot/compressed/vmlinux has an output section .discard.unreachable , which is likely desired.
>
>You mean /not/ desired, right?

You are right:) I meant "undesired"

>
>>
>> Note that arch/x86/kernel/vmlinux.lds.S has an output section description /DISCARD/ : { ... *(.discard.*) ... },
>> but arch/x86/boot/compressed/vmlinux doesn't.
>>
>> We can let arch/x86/boot/compressed/vmlinux reuse the /DISCARD/ to fix the issue.
>
>Yep.

git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git HEAD
does not have the warning.
https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git HEAD has the
warning.

Sent http://lore.kernel.org/r/20200520182010.242489-1-maskray@google.com
"[PATCH] x86/boot: Discard .discard.unreachable for arch/x86/boot/compressed/vmlinux"
which should fix the problem.

I am still a kernel newbie. I set To: to you and both x86@kernel.org and
linux-efi@vger.kernel.org
Hope that is correct.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
  2020-05-20 17:56           ` Nick Desaulniers
@ 2020-05-21  0:23             ` Philip Li
  0 siblings, 0 replies; 9+ messages in thread
From: Philip Li @ 2020-05-21  0:23 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Arvind Sankar, Fangrui Song, Ard Biesheuvel, kbuild test robot,
	kbuild-all, clang-built-linux, linux-efi, Chen Rong

On Wed, May 20, 2020 at 10:56:28AM -0700, Nick Desaulniers wrote:
> On Wed, May 20, 2020 at 10:41 AM Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > As an aside, how does one (should I) get onto kbuild-all? It keeps
> > bouncing me as a non-list member currently.
I think this is the setting of kbuild-all 01.org, you may need subscrible to
kbuild-all@lists.01.org mailing list to avoid this.

> 
> Philip Li <philip.li@intel.com>
> Chen Rong <rong.a.chen@intel.com>
> are the two folks I always reference for 0day bot related questions. I
> haven't seen bounces, but I also don't recall subscribing to any
> related mailing lists.  Maybe I was added to one?
Yes, and you can send mail to lkp@intel.com, which is the contact mail
that 0-day ci side is using.

> -- 
> Thanks,
> ~Nick Desaulniers

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-21  0:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  2:28 [efi:next 22/40] ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol '' kbuild test robot
2020-05-20 15:53 ` Arvind Sankar
2020-05-20 16:14   ` Ard Biesheuvel
2020-05-20 17:34     ` Fangrui Song
2020-05-20 17:39       ` Arvind Sankar
2020-05-20 17:41         ` Arvind Sankar
2020-05-20 17:56           ` Nick Desaulniers
2020-05-21  0:23             ` Philip Li
2020-05-20 18:26         ` Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).