* Re: [peterz-queue:sched/urgent 4/5] ld.lld: error: section .text at 0xFFFFFFFF80200000 of size 0x1E8915C exceeds available address space
2020-04-04 13:15 ` Jiaxun Yang
@ 2020-04-04 16:19 ` Fangrui Song
2020-04-04 21:59 ` Nathan Chancellor
2020-04-06 17:34 ` Nick Desaulniers
2 siblings, 0 replies; 7+ messages in thread
From: Fangrui Song @ 2020-04-04 16:19 UTC (permalink / raw)
To: Jiaxun Yang
Cc: linux-mips, Nathan Chancellor, Nick Desaulniers, Rui Ueyama,
George Rimar, Sebastian Andrzej Siewior, kbuild-all,
clang-built-linux, Peter Zijlstra, kbuild test robot, Philip Li
On 2020-04-04, Jiaxun Yang wrote:
>On Fri, 3 Apr 2020 18:32:04 -0700
>Fangrui Song <maskray@google.com> wrote:
>
>>
>> Reproduce for a clang/lld developer:
>>
>> make -j$(nproc) ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu-
>> LD=ld.lld O=/tmp/out/mipsel distclean malta_defconfig vmlinux
>> (Requires mipsel-linux-gnu-as and clang in PATH)
>>
>> I have noticed multiple problems.
>>
>> % file .tmp_vmlinux.kallsyms1
>> .tmp_vmlinux.kallsyms1: ELF 32-bit LSB executable, MIPS, MIPS32 rel2
>> version 1 (SYSV), statically linked,
>> BuildID[sha1]=ff348ad92c80e525b3f14149e57e8987de66e041, not stripped
>>
>> In arch/mips/kernel/vmlinux.lds.S, VMLINUX_LOAD_ADDRESS (from load-y)
>> is 0xffffffff8010000. GNU ld seems to allow 64-bit addresses when
>> linking an ELFCLASS32 file. The addresses will be truncated to
>> 32-bit. This behavior seems error-prone to me.
>>
>> lld does the right thing by erroring out. I do notice a display
>> problem of lld -Map and I have a patch to address that:
>> https://reviews.llvm.org/D77445
>>
>> For 32-bit linux-mips, the right approach seems to be make
>> VMLINUX_LOAD_ADDRESS fit into 32-bit. However, my Linux-fu and
>> MIPS-fu is not strong enough to do this :/
>
>Hi MaskRay,
>
>Could you please try this?
>
>--- a/arch/mips/mti-malta/Platform
>+++ b/arch/mips/mti-malta/Platform
>@@ -6,6 +6,10 @@ cflags-$(CONFIG_MIPS_MALTA) +=
>-I$(srctree)/arch/mips/include/asm/mach-malta ifdef CONFIG_KVM_GUEST
> load-$(CONFIG_MIPS_MALTA) += 0x0000000040100000
> else
>+ifdef CONFIG_64BIT
> load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
>+else
>+ load-$(CONFIG_MIPS_MALTA) += 0x80100000
>+endif
> endif
> all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
>
>Thanks.
>
>--
>Jiaxun Yang
Thanks! The patch fixes the problem linking with LLD.
If you are going to send a patch,
Reviewed-by: Fangrui Song <maskray@google.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [peterz-queue:sched/urgent 4/5] ld.lld: error: section .text at 0xFFFFFFFF80200000 of size 0x1E8915C exceeds available address space
2020-04-04 13:15 ` Jiaxun Yang
2020-04-04 16:19 ` Fangrui Song
@ 2020-04-04 21:59 ` Nathan Chancellor
2020-04-05 1:00 ` Philip Li
2020-04-06 17:34 ` Nick Desaulniers
2 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2020-04-04 21:59 UTC (permalink / raw)
To: Jiaxun Yang
Cc: Fangrui Song, linux-mips, Nick Desaulniers, Rui Ueyama,
George Rimar, Sebastian Andrzej Siewior, kbuild-all,
clang-built-linux, Peter Zijlstra, kbuild test robot, Philip Li
On Sat, Apr 04, 2020 at 09:15:31PM +0800, Jiaxun Yang wrote:
> On Fri, 3 Apr 2020 18:32:04 -0700
> Fangrui Song <maskray@google.com> wrote:
>
> >
> > Reproduce for a clang/lld developer:
> >
> > make -j$(nproc) ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu-
> > LD=ld.lld O=/tmp/out/mipsel distclean malta_defconfig vmlinux
> > (Requires mipsel-linux-gnu-as and clang in PATH)
> >
> > I have noticed multiple problems.
> >
> > % file .tmp_vmlinux.kallsyms1
> > .tmp_vmlinux.kallsyms1: ELF 32-bit LSB executable, MIPS, MIPS32 rel2
> > version 1 (SYSV), statically linked,
> > BuildID[sha1]=ff348ad92c80e525b3f14149e57e8987de66e041, not stripped
> >
> > In arch/mips/kernel/vmlinux.lds.S, VMLINUX_LOAD_ADDRESS (from load-y)
> > is 0xffffffff8010000. GNU ld seems to allow 64-bit addresses when
> > linking an ELFCLASS32 file. The addresses will be truncated to
> > 32-bit. This behavior seems error-prone to me.
> >
> > lld does the right thing by erroring out. I do notice a display
> > problem of lld -Map and I have a patch to address that:
> > https://reviews.llvm.org/D77445
> >
> > For 32-bit linux-mips, the right approach seems to be make
> > VMLINUX_LOAD_ADDRESS fit into 32-bit. However, my Linux-fu and
> > MIPS-fu is not strong enough to do this :/
>
> Hi MaskRay,
>
> Could you please try this?
>
> --- a/arch/mips/mti-malta/Platform
> +++ b/arch/mips/mti-malta/Platform
> @@ -6,6 +6,10 @@ cflags-$(CONFIG_MIPS_MALTA) +=
> -I$(srctree)/arch/mips/include/asm/mach-malta ifdef CONFIG_KVM_GUEST
> load-$(CONFIG_MIPS_MALTA) += 0x0000000040100000
> else
> +ifdef CONFIG_64BIT
> load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
> +else
> + load-$(CONFIG_MIPS_MALTA) += 0x80100000
> +endif
> endif
> all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
>
> Thanks.
>
> --
> Jiaxun Yang
Thank you, that fixes the error and I see no new ones. I tested
malta_defconfig, which boots in QEMU:
Linux version 5.6.0-next-20200404-dirty (nathan@ubuntu-m2-xlarge-x86) (ClangBuiltLinux clang version 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8), LLD 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8)) #1 SMP Sat Apr 4 14:54:45 MST 2020
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [peterz-queue:sched/urgent 4/5] ld.lld: error: section .text at 0xFFFFFFFF80200000 of size 0x1E8915C exceeds available address space
2020-04-04 21:59 ` Nathan Chancellor
@ 2020-04-05 1:00 ` Philip Li
2020-04-05 1:39 ` Nathan Chancellor
0 siblings, 1 reply; 7+ messages in thread
From: Philip Li @ 2020-04-05 1:00 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Jiaxun Yang, Fangrui Song, linux-mips, Nick Desaulniers,
Rui Ueyama, George Rimar, Sebastian Andrzej Siewior, kbuild-all,
clang-built-linux, Peter Zijlstra, kbuild test robot
On Sat, Apr 04, 2020 at 02:59:16PM -0700, Nathan Chancellor wrote:
> On Sat, Apr 04, 2020 at 09:15:31PM +0800, Jiaxun Yang wrote:
> > On Fri, 3 Apr 2020 18:32:04 -0700
> > Fangrui Song <maskray@google.com> wrote:
> >
> > >
> > > Reproduce for a clang/lld developer:
> > >
> > > make -j$(nproc) ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu-
> > > LD=ld.lld O=/tmp/out/mipsel distclean malta_defconfig vmlinux
> > > (Requires mipsel-linux-gnu-as and clang in PATH)
> > >
> > > I have noticed multiple problems.
> > >
> > > % file .tmp_vmlinux.kallsyms1
> > > .tmp_vmlinux.kallsyms1: ELF 32-bit LSB executable, MIPS, MIPS32 rel2
> > > version 1 (SYSV), statically linked,
> > > BuildID[sha1]=ff348ad92c80e525b3f14149e57e8987de66e041, not stripped
> > >
> > > In arch/mips/kernel/vmlinux.lds.S, VMLINUX_LOAD_ADDRESS (from load-y)
> > > is 0xffffffff8010000. GNU ld seems to allow 64-bit addresses when
> > > linking an ELFCLASS32 file. The addresses will be truncated to
> > > 32-bit. This behavior seems error-prone to me.
> > >
> > > lld does the right thing by erroring out. I do notice a display
> > > problem of lld -Map and I have a patch to address that:
> > > https://reviews.llvm.org/D77445
> > >
> > > For 32-bit linux-mips, the right approach seems to be make
> > > VMLINUX_LOAD_ADDRESS fit into 32-bit. However, my Linux-fu and
> > > MIPS-fu is not strong enough to do this :/
> >
> > Hi MaskRay,
> >
> > Could you please try this?
> >
> > --- a/arch/mips/mti-malta/Platform
> > +++ b/arch/mips/mti-malta/Platform
> > @@ -6,6 +6,10 @@ cflags-$(CONFIG_MIPS_MALTA) +=
> > -I$(srctree)/arch/mips/include/asm/mach-malta ifdef CONFIG_KVM_GUEST
> > load-$(CONFIG_MIPS_MALTA) += 0x0000000040100000
> > else
> > +ifdef CONFIG_64BIT
> > load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
> > +else
> > + load-$(CONFIG_MIPS_MALTA) += 0x80100000
> > +endif
> > endif
> > all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
> >
> > Thanks.
> >
> > --
> > Jiaxun Yang
>
> Thank you, that fixes the error and I see no new ones. I tested
> malta_defconfig, which boots in QEMU:
>
> Linux version 5.6.0-next-20200404-dirty (nathan@ubuntu-m2-xlarge-x86) (ClangBuiltLinux clang version 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8), LLD 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8)) #1 SMP Sat Apr 4 14:54:45 MST 2020
>
> Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Hi all, want to consult, does it mean 0-day ci doesn't need blacklist
this ld.lld error anymore? This is a kernel problem and the error itself
is valid.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [peterz-queue:sched/urgent 4/5] ld.lld: error: section .text at 0xFFFFFFFF80200000 of size 0x1E8915C exceeds available address space
2020-04-05 1:00 ` Philip Li
@ 2020-04-05 1:39 ` Nathan Chancellor
0 siblings, 0 replies; 7+ messages in thread
From: Nathan Chancellor @ 2020-04-05 1:39 UTC (permalink / raw)
To: Philip Li
Cc: Jiaxun Yang, Fangrui Song, linux-mips, Nick Desaulniers,
Rui Ueyama, George Rimar, Sebastian Andrzej Siewior, kbuild-all,
clang-built-linux, Peter Zijlstra, kbuild test robot
On Sun, Apr 05, 2020 at 09:00:05AM +0800, Philip Li wrote:
> On Sat, Apr 04, 2020 at 02:59:16PM -0700, Nathan Chancellor wrote:
> > On Sat, Apr 04, 2020 at 09:15:31PM +0800, Jiaxun Yang wrote:
> > > On Fri, 3 Apr 2020 18:32:04 -0700
> > > Fangrui Song <maskray@google.com> wrote:
> > >
> > > >
> > > > Reproduce for a clang/lld developer:
> > > >
> > > > make -j$(nproc) ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu-
> > > > LD=ld.lld O=/tmp/out/mipsel distclean malta_defconfig vmlinux
> > > > (Requires mipsel-linux-gnu-as and clang in PATH)
> > > >
> > > > I have noticed multiple problems.
> > > >
> > > > % file .tmp_vmlinux.kallsyms1
> > > > .tmp_vmlinux.kallsyms1: ELF 32-bit LSB executable, MIPS, MIPS32 rel2
> > > > version 1 (SYSV), statically linked,
> > > > BuildID[sha1]=ff348ad92c80e525b3f14149e57e8987de66e041, not stripped
> > > >
> > > > In arch/mips/kernel/vmlinux.lds.S, VMLINUX_LOAD_ADDRESS (from load-y)
> > > > is 0xffffffff8010000. GNU ld seems to allow 64-bit addresses when
> > > > linking an ELFCLASS32 file. The addresses will be truncated to
> > > > 32-bit. This behavior seems error-prone to me.
> > > >
> > > > lld does the right thing by erroring out. I do notice a display
> > > > problem of lld -Map and I have a patch to address that:
> > > > https://reviews.llvm.org/D77445
> > > >
> > > > For 32-bit linux-mips, the right approach seems to be make
> > > > VMLINUX_LOAD_ADDRESS fit into 32-bit. However, my Linux-fu and
> > > > MIPS-fu is not strong enough to do this :/
> > >
> > > Hi MaskRay,
> > >
> > > Could you please try this?
> > >
> > > --- a/arch/mips/mti-malta/Platform
> > > +++ b/arch/mips/mti-malta/Platform
> > > @@ -6,6 +6,10 @@ cflags-$(CONFIG_MIPS_MALTA) +=
> > > -I$(srctree)/arch/mips/include/asm/mach-malta ifdef CONFIG_KVM_GUEST
> > > load-$(CONFIG_MIPS_MALTA) += 0x0000000040100000
> > > else
> > > +ifdef CONFIG_64BIT
> > > load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
> > > +else
> > > + load-$(CONFIG_MIPS_MALTA) += 0x80100000
> > > +endif
> > > endif
> > > all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
> > >
> > > Thanks.
> > >
> > > --
> > > Jiaxun Yang
> >
> > Thank you, that fixes the error and I see no new ones. I tested
> > malta_defconfig, which boots in QEMU:
> >
> > Linux version 5.6.0-next-20200404-dirty (nathan@ubuntu-m2-xlarge-x86) (ClangBuiltLinux clang version 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8), LLD 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8)) #1 SMP Sat Apr 4 14:54:45 MST 2020
> >
> > Tested-by: Nathan Chancellor <natechancellor@gmail.com>
> Hi all, want to consult, does it mean 0-day ci doesn't need blacklist
> this ld.lld error anymore? This is a kernel problem and the error itself
> is valid.
The error is valid it seems but no commit should be blamed for causing
that error. In other words, it should be fine to un-blacklist it but
emails should not be sent to patch authors if that error is the only
error in the log.
Cheers,
Nathan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [peterz-queue:sched/urgent 4/5] ld.lld: error: section .text at 0xFFFFFFFF80200000 of size 0x1E8915C exceeds available address space
2020-04-04 13:15 ` Jiaxun Yang
2020-04-04 16:19 ` Fangrui Song
2020-04-04 21:59 ` Nathan Chancellor
@ 2020-04-06 17:34 ` Nick Desaulniers
2 siblings, 0 replies; 7+ messages in thread
From: Nick Desaulniers @ 2020-04-06 17:34 UTC (permalink / raw)
To: Jiaxun Yang
Cc: Fangrui Song, linux-mips, Nathan Chancellor, Rui Ueyama,
George Rimar, Sebastian Andrzej Siewior, kbuild-all,
clang-built-linux, Peter Zijlstra, kbuild test robot, Philip Li
On Sat, Apr 4, 2020 at 6:16 AM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>
> On Fri, 3 Apr 2020 18:32:04 -0700
> Fangrui Song <maskray@google.com> wrote:
>
> >
> > Reproduce for a clang/lld developer:
> >
> > make -j$(nproc) ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu-
> > LD=ld.lld O=/tmp/out/mipsel distclean malta_defconfig vmlinux
> > (Requires mipsel-linux-gnu-as and clang in PATH)
> >
> > I have noticed multiple problems.
> >
> > % file .tmp_vmlinux.kallsyms1
> > .tmp_vmlinux.kallsyms1: ELF 32-bit LSB executable, MIPS, MIPS32 rel2
> > version 1 (SYSV), statically linked,
> > BuildID[sha1]=ff348ad92c80e525b3f14149e57e8987de66e041, not stripped
> >
> > In arch/mips/kernel/vmlinux.lds.S, VMLINUX_LOAD_ADDRESS (from load-y)
> > is 0xffffffff8010000. GNU ld seems to allow 64-bit addresses when
> > linking an ELFCLASS32 file. The addresses will be truncated to
> > 32-bit. This behavior seems error-prone to me.
> >
> > lld does the right thing by erroring out. I do notice a display
> > problem of lld -Map and I have a patch to address that:
> > https://reviews.llvm.org/D77445
> >
> > For 32-bit linux-mips, the right approach seems to be make
> > VMLINUX_LOAD_ADDRESS fit into 32-bit. However, my Linux-fu and
> > MIPS-fu is not strong enough to do this :/
>
> Hi MaskRay,
>
> Could you please try this?
Hi Jiaxun, can you please send this patch?
>
> --- a/arch/mips/mti-malta/Platform
> +++ b/arch/mips/mti-malta/Platform
> @@ -6,6 +6,10 @@ cflags-$(CONFIG_MIPS_MALTA) +=
> -I$(srctree)/arch/mips/include/asm/mach-malta ifdef CONFIG_KVM_GUEST
> load-$(CONFIG_MIPS_MALTA) += 0x0000000040100000
> else
> +ifdef CONFIG_64BIT
> load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
> +else
> + load-$(CONFIG_MIPS_MALTA) += 0x80100000
> +endif
> endif
> all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
>
> Thanks.
>
> --
> Jiaxun Yang
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 7+ messages in thread