https://sourceware.org/bugzilla/show_bug.cgi?id=33246
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Sam James <sam at gentoo dot org> ---
Arch is using -ffat-lto-objects:
https://gitlab.archlinux.org/archlinux/packaging/packages/elfutils/-/blob/main/PKGBUILD?ref_type=heads#L61
If I build elfutils-0.193 with -O2 -ffat-lto-objects -flto:
$ ls -hal ./libelf/libelf.a
-rw-r--r-- 1 sam sam 1.8M Aug 2 04:16 ./libelf/libelf.a
$ readelf -S ./libelf/libelf.a
[...]
[ 5] .gnu.lto_.pr[...] PROGBITS 0000000000000000 000000a2
000000000000000f 0000000000000000 E 0 0 1
[ 6] .gnu.lto_.ic[...] PROGBITS 0000000000000000 000000b1
000000000000001e 0000000000000000 E 0 0 1
[ 7] .gnu.lto_.ip[...] PROGBITS 0000000000000000 000000cf
000000000000003e 0000000000000000 E 0 0 1
[ 8] .gnu.lto_.in[...] PROGBITS 0000000000000000 0000010d
000000000000005f 0000000000000000 E 0 0 1
[ 9] .gnu.lto_.jm[...] PROGBITS 0000000000000000 0000016c
0000000000000179 0000000000000000 E 0 0 1
[10] .gnu.lto_.pu[...] PROGBITS 0000000000000000 000002e5
0000000000000011 0000000000000000 E 0 0 1
[11] .gnu.lto_.ip[...] PROGBITS 0000000000000000 000002f6
0000000000000031 0000000000000000 E 0 0 1
[12] .gnu.lto_.lt[...] PROGBITS 0000000000000000 00000327
0000000000000008 0000000000000000 E 0 0 1
[13] .gnu.lto_pri[...] PROGBITS 0000000000000000 0000032f
00000000000002dd 0000000000000000 E 0 0 1
[14] .gnu.lto_.sy[...] PROGBITS 0000000000000000 0000060c
0000000000000054 0000000000000000 E 0 0 1
[15] .gnu.lto_.re[...] PROGBITS 0000000000000000 00000660
000000000000000e 0000000000000000 E 0 0 1
[16] .gnu.lto_.de[...] PROGBITS 0000000000000000 0000066e
0000000000000e59 0000000000000000 E 0 0 1
[17] .gnu.lto_.sy[...] PROGBITS 0000000000000000 000014c7
000000000000001d 0000000000000000 E 0 0 1
[18] .gnu.lto_.ex[...] PROGBITS 0000000000000000 000014e4
0000000000000003 0000000000000000 E 0 0 1
[19] .gnu.lto_.opts PROGBITS 0000000000000000 000014e7
000000000000008e 0000000000000000 E 0 0 1
[...]
$ strip -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 ./libelf/libelf.a -o
./libelf/libelf-2.a
-rw-r--r-- 1 sam sam 394K Aug 2 04:18 ./libelf/libelf-2.a
$ readelf -S ./libelf/libelf-2.a
[...]
[ 5] .rodata.str1.1 PROGBITS 0000000000000000 000000a2
0000000000000035 0000000000000001 AMS 0 0 1
[ 6] .rodata.str1.8 PROGBITS 0000000000000000 000000d8
00000000000000c7 0000000000000001 AMS 0 0 8
[ 7] .comment PROGBITS 0000000000000000 0000019f
000000000000009d 0000000000000001 MS 0 0 1
[ 8] .note.GNU-stack PROGBITS 0000000000000000 0000023c
0000000000000000 0000000000000000 0 0 1
[ 9] .note.gnu.pr[...] NOTE 0000000000000000 00000240
0000000000000030 0000000000000000 A 0 0 8
[10] .eh_frame PROGBITS 0000000000000000 00000270
0000000000000038 0000000000000000 A 0 0 8
[11] .rela.eh_frame RELA 0000000000000000 00000550
0000000000000018 0000000000000018 I 14 10 8
[...]
Then without -N __gnu_lto_v1:
$ strip -R .gnu.lto_* -R .gnu.debuglto_* ./libelf/libelf.a -o
./libelf/libelf-1.a
$ ls -hal ./libelf/libelf-{1,2}.a
-rw-r--r-- 1 sam sam 254K Aug 2 04:23 ./libelf/libelf-1.a
-rw-r--r-- 1 sam sam 394K Aug 2 04:24 ./libelf/libelf-2.a
When you use `-R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1`, we interpret
it as you asking "please only strip the LTO sections to make this as-if a
-ffat-lto-object'd binary was never used with LTO". It's a feature.
--
You are receiving this mail because:
You are on the CC list for the bug.