[PATCH] arm64: remove special treatment for the link order of head.o

Eduard Zingerman eddyz87 at gmail.com
Tue Mar 28 03:33:29 PDT 2023


On Sat, 2023-03-25 at 20:42 +0900, Masahiro Yamada wrote:
[...]
> > Strange.
> > 
> > I used the .config file Aurelien provided, but
> > I still cannot reproduce this issue.
> > 
> > 
> > The vmlinux size is small
> > as-is in the current mainline.
> > 
> > 
> > 
> > [mainline]
> > 
> > 
> > masahiro at zoe:~/ref/linux(master)$ git log --oneline -1
> > 65aca32efdcb (HEAD -> master, origin/master, origin/HEAD) Merge tag
> > 'mm-hotfixes-stable-2023-03-24-17-09' of
> > git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> > masahiro at zoe:~/ref/linux(master)$ aarch64-linux-gnu-size  vmlinux
> >    text    data     bss     dec     hex filename
> > 24561282 8186912 622032 33370226 1fd3072 vmlinux
> > masahiro at zoe:~/ref/linux(master)$ aarch64-linux-gnu-readelf -S
> > vmlinux | grep -A1 BTF
> >   [15] .BTF              PROGBITS         ffff8000091c0708  011d0708
> >        000000000048209c  0000000000000000   A       0     0     1
> >   [16] .BTF_ids          PROGBITS         ffff8000096427a4  016527a4
> >        0000000000000a1c  0000000000000000   A       0     0     1
> > 
> > 
> > 
> > 
> > [mainline + revert 994b7ac]
> > 
> > masahiro at zoe:~/ref/linux2(testing)$ git log --oneline -2
> > 856c80dd789c (HEAD -> testing) Revert "arm64: remove special treatment
> > for the link order of head.o"
> > 65aca32efdcb (origin/master, origin/HEAD, master) Merge tag
> > 'mm-hotfixes-stable-2023-03-24-17-09' of
> > git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> > masahiro at zoe:~/ref/linux2(testing)$ aarch64-linux-gnu-size  vmlinux
> >    text    data     bss     dec     hex filename
> > 24561329 8186912 622032 33370273 1fd30a1 vmlinux
> > masahiro at zoe:~/ref/linux2(testing)$ aarch64-linux-gnu-readelf -S
> > vmlinux | grep -A1 BTF
> >   [15] .BTF              PROGBITS         ffff8000091c0708  011d0708
> >        00000000004820cb  0000000000000000   A       0     0     1
> >   [16] .BTF_ids          PROGBITS         ffff8000096427d4  016527d4
> >        0000000000000a1c  0000000000000000   A       0     0     1
> > 
> > 
> > 
> > I still do not know what affects reproducibility.
> > (compiler version, pahole version, etc. ?)
> > 
> > 
> > 
> > 
> > Aurelien used GCC 12 + binutils 2.40, but
> > my toolchain is a bit older.
> > 
> > 
> > 
> > FWIW, I tested this on Ubuntu 22.04LTS.
> > 
> > masahiro at zoe:~/ref/linux(master)$ aarch64-linux-gnu-gcc --version
> > aarch64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
> > Copyright (C) 2021 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > 
> > masahiro at zoe:~/ref/linux(master)$ pahole --version
> > v1.22
> > 
> > masahiro at zoe:~/ref/linux(master)$ aarch64-linux-gnu-as --version
> > GNU assembler (GNU Binutils for Ubuntu) 2.38
> > Copyright (C) 2022 Free Software Foundation, Inc.
> > This program is free software; you may redistribute it under the terms of
> > the GNU General Public License version 3 or later.
> > This program has absolutely no warranty.
> > This assembler was configured for a target of `aarch64-linux-gnu'.
> 
> 
> 
> 
> 
> I did the same things in Deiban sid
> in order to use newer versions of tools.


Hi Masahiro,

An upgrade from gcc 11 to gcc 12, BTF section increase and a number of
duplicate IDs reported by resolve_btfids matches the description of
the following thread:

https://lore.kernel.org/bpf/Y%2FP1yxAuV6Wj3A0K@google.com/

The issue is caused by change in GNU assembler DWARF generation.
I've sent a patch to fix it a few weeks ago and it is merged in
dwarves master:

a9498899109d ("dwarf_loader: Fix for BTF id drift caused by adding unspecified types")

Could you please grab a fresh version of dwarves from:

git at github.com:acmel/dwarves.git

compile 'pahole' and try with?

Thanks,
Eduard

> 
> 
> 
> Yup, I saw a huge increase in the .BTF section,
> and observed the difference w/wo 994b7ac.
> 
> masahiro at 3e9802d667e3:~/ref/linux2$ aarch64-linux-gnu-readelf -S
> vmlinux | grep -A1 BTF
>   [15] .BTF              PROGBITS         ffff8000091d26c4  011e26c4
>        000000000093e626  0000000000000000   A       0     0     1
>   [16] .BTF_ids          PROGBITS         ffff800009b10cec  01b20cec
>        0000000000000a1c  0000000000000000   A       0     0     1
> 
> 
> I guess some tool might be affecting this.
> Even with 994b7ac reverted, the .BTF section
> is much bigger.
> 
> 
> At the same time, I saw a ton of warnings
> while building BTF.
> 
> 
> masahiro at 3e9802d667e3:~/ref/linux2$ cat /etc/os-release
> PRETTY_NAME="Debian GNU/Linux bookworm/sid"
> NAME="Debian GNU/Linux"
> VERSION_CODENAME=bookworm
> ID=debian
> HOME_URL="https://www.debian.org/"
> SUPPORT_URL="https://www.debian.org/support"
> BUG_REPORT_URL="https://bugs.debian.org/"
> 
> 
> 
>   LD      vmlinux
>   BTFIDS  vmlinux
> WARN: multiple IDs found for 'task_struct': 177, 16690 - using 177
> WARN: multiple IDs found for 'file': 517, 16712 - using 517
> WARN: multiple IDs found for 'vm_area_struct': 524, 16714 - using 524
> WARN: multiple IDs found for 'inode': 586, 16773 - using 586
> WARN: multiple IDs found for 'path': 618, 16802 - using 618
> WARN: multiple IDs found for 'task_struct': 177, 17267 - using 177
> WARN: multiple IDs found for 'file': 517, 17312 - using 517
> WARN: multiple IDs found for 'vm_area_struct': 524, 17315 - using 524
> WARN: multiple IDs found for 'seq_file': 1029, 17376 - using 1029
> WARN: multiple IDs found for 'inode': 586, 17494 - using 586
> WARN: multiple IDs found for 'path': 618, 17523 - using 618
> WARN: multiple IDs found for 'cgroup': 704, 17532 - using 704
> WARN: multiple IDs found for 'task_struct': 177, 18652 - using 177
> WARN: multiple IDs found for 'file': 517, 18704 - using 517
> WARN: multiple IDs found for 'vm_area_struct': 524, 18707 - using 524
> WARN: multiple IDs found for 'seq_file': 1029, 18781 - using 1029
> WARN: multiple IDs found for 'inode': 586, 18911 - using 586
> WARN: multiple IDs found for 'path': 618, 18940 - using 618
> WARN: multiple IDs found for 'cgroup': 704, 18949 - using 704
> WARN: multiple IDs found for 'task_struct': 177, 20514 - using 177
> WARN: multiple IDs found for 'file': 517, 20515 - using 517
> WARN: multiple IDs found for 'vm_area_struct': 524, 20541 - using 524
> WARN: multiple IDs found for 'inode': 586, 20595 - using 586
> WARN: multiple IDs found for 'path': 618, 20624 - using 618
> WARN: multiple IDs found for 'cgroup': 704, 20639 - using 704
> WARN: multiple IDs found for 'seq_file': 1029, 20801 - using 1029
>    ...
> 
> 
> 
> 
> I am not sure whether these warnings are related to
> the current issue or not.
> 
> 
> I did not look into it any further.
> I may not be seeing a sane build result.
> 
> 




More information about the linux-arm-kernel mailing list