|
Description
Thierry Vignaud
2020-04-21 16:35:59 CEST
I confirm that the behavior is consistent on Fedora/CentOs/Debian. Only mga saw such "symbol leaks" You can test by using:
$ echo 'int main() {}'>test.c
$ gcc -o test test.c -g
$ LC_ALL=C readelf --debug-dump=info test|grep csu
<24> DW_AT_comp_dir : (indirect string, offset: 0x1a): /home/iurt/rpmbuild/BUILD/glibc-2.31/csu
<43> DW_AT_comp_dir : (indirect string, offset: 0x1a): /home/iurt/rpmbuild/BUILD/glibc-2.31/csu
<86> DW_AT_comp_dir : (indirect string, offset: 0x1a): /home/iurt/rpmbuild/BUILD/glibc-2.31/csu
<a5> DW_AT_comp_dir : (indirect string, offset: 0x1a): /home/iurt/rpmbuild/BUILD/glibc-2.31/csu
<143> DW_AT_name : (indirect string, offset: 0x1c0): __libc_csu_fini
<15d> DW_AT_name : (indirect string, offset: 0x2d5): __libc_csu_init
<241> DW_AT_comp_dir : (indirect string, offset: 0x1a): /home/iurt/rpmbuild/BUILD/glibc-2.31/csu
Humm, on second though, it might not be glibc, but it could be gcc/binutils or the combinaison of the lot of them, or our build flags when building glibc(?).
If you compile the same dumb test program (w/o any flags) under Fedora & on Mageia, using readelf against the same Mageia's glibc give different results:
$ LC_ALL=C readelf --debug-dump=info ~/t-FC|grep DW_AT_name
<11> DW_AT_name : t.c
<2e> DW_AT_name : (indirect string, offset: 0x6a): main
<4e> DW_AT_name : int
$ LC_ALL=C readelf --debug-dump=info ~/t-mga|grep DW_AT_name
<20> DW_AT_name : (indirect string, offset: 0x0): ../sysdeps/x86_64/start.S
<3f> DW_AT_name : (indirect string, offset: 0x1a7): init.c
<4c> DW_AT_name : (indirect string, offset: 0x13f): _IO_stdin_used
<64> DW_AT_name : int
<82> DW_AT_name : (indirect string, offset: 0x15d): ../sysdeps/x86_64/crti.S
<a1> DW_AT_name : (indirect string, offset: 0x1a3): elf-init.c
<c0> DW_AT_name : (indirect string, offset: 0x17b): long int
<c5> DW_AT_name : (indirect string, offset: 0x197): size_t
<d8> DW_AT_name : (indirect string, offset: 0x1ae): long unsigned int
<df> DW_AT_name : int
<e6> DW_AT_name : (indirect string, offset: 0x176): long long int
<ed> DW_AT_name : (indirect string, offset: 0x2ea): long double
<126> DW_AT_name : (indirect string, offset: 0x2c6): char
<12b> DW_AT_name : (indirect string, offset: 0x184): __init_array_start
<137> DW_AT_name : (indirect string, offset: 0x2f6): __init_array_end
<143> DW_AT_name : (indirect string, offset: 0x1c0): __libc_csu_fini
<15d> DW_AT_name : (indirect string, offset: 0x2d5): __libc_csu_init
<17b> DW_AT_name : (indirect string, offset: 0x2cb): argc
<18f> DW_AT_name : (indirect string, offset: 0x2e5): argv
<1a3> DW_AT_name : (indirect string, offset: 0x19e): envp
<1b7> DW_AT_name : (indirect string, offset: 0x2d0): size
<1e0> DW_AT_name : i
<221> DW_AT_name : (indirect string, offset: 0x2df): _init
<23d> DW_AT_name : (indirect string, offset: 0x307): ../sysdeps/x86_64/crtn.S
Striping symbols make all of that disappear
Created attachment 11622 [details]
we never ever ship glibc-debug in mga...
Created attachment 11623 [details]
kill very old obsoletes
Created attachment 11624 [details]
Generating debuginfo like FC does remove most references to CSU ( "C start up") but one
Created attachment 11625 [details]
"readelf --debug-dump=info" of bogus minimal C program on Fedora
Just run:
echo 'int main() {}'>t.c && gcc -o t t.c && readelf --debug-dump=info t
Created attachment 11626 [details]
"readelf --debug-dump=info" of bogus minimal C program on Centos7
Created attachment 11627 [details]
"readelf --debug-dump=info" of bogus minimal C program on Debian
Created attachment 11628 [details]
"readelf --debug-dump=info" of bogus minimal C program on Mageia (10x bigger output!)
Created attachment 11629 [details]
"readelf --debug-dump=info" of bogus minimal C program on Mageia (patched glibc)
Only one reference to /home/tv/mga/pkgs/glibc/BUILD/glibc-2.31/csu when glibc is patched with attached patch
Thomas, are you OK if I run "git svn dcommit" for the first 2 patches? - cleaning -debug subpkg which was never emitted (and thus never tested) for 10+ years - killing very old obsoletes BTW Thomas, if you want to play with rpm's testsuite: 1) disable patch 183 2) build it 3) you can play with the 2 tests broken by glibc with: ./rpmtests 350 ./rpmtests 351 You'll see the extra line that breaks the tests: +pkgs/glibc/BUILD/glibc-2.31/csu In the ./rpmtests.log file (one extra line with my patch over glibc.patch, quite a lot more if using Cauldron's glibc) $ rpm -ql glibc-devel|LC_ALL=C xargs fgrep 'pkgs/glibc/BUILD/glibc-2.31/csu' Binary file /usr/lib/Mcrt1.o matches Binary file /usr/lib/Scrt1.o matches Binary file /usr/lib/crt1.o matches Binary file /usr/lib/crti.o matches Binary file /usr/lib/crtn.o matches Binary file /usr/lib/gcrt1.o matches Binary file /usr/lib/libc_nonshared.a matches Binary file /usr/lib64/libc_nonshared.a matches Created attachment 11630 [details]
strip debug from libc_nonshared.a
This fixes the last reference of /home/tv/mga/pkgs/glibc/BUILD/glibc-2.31/csu (comparing with my previous glibc build, vs 5 "/home/iurt/rpmbuild/BUILD/glibc-2.31/csu" if comparing with Cauldron's glibc)
BTW the srtip loop above does nothing, at least on x86_64:
+ [[ x86_64 != \x\8\6\_\6\4 ]]
+ pushd /home/tv/mga/pkgs/glibc/BUILDROOT/glibc-2.31-8.1.mga8.x86_64/lib64
~/mga/pkgs/glibc/BUILDROOT/glibc-2.31-8.1.mga8.x86_64/lib64 ~/mga/pkgs/glibc/BUILD/glibc-2.31
+ for i in *.a
+ '[' -f '*.a' ']'
+ popd
Created attachment 11631 [details]
"readelf --debug-dump=info" of bogus minimal C program on Mageia (uber-patched glibc)
Note that the readelf ouput is now similar to Fedora/CentOs/Debian:
- <15> DW_AT_comp_dir : (indirect string, offset: 0x0): /home/tvignaud/Téléchargements
+ <11> DW_AT_name : (indirect string, offset: 0x47): /home/tv/t.c
+ <15> DW_AT_comp_dir : (indirect string, offset: 0x0): /home/tv/mga/pkgs/glibc
(In reply to Thierry Vignaud from comment #12) > Thomas, are you OK if I run "git svn dcommit" for the first 2 patches? > - cleaning -debug subpkg which was never emitted (and thus never tested) for > 10+ years > - killing very old obsoletes Ack on theese two... I will look at the rest soon-ish fixes added in glibc-2.31-10.mga8 Status:
NEW =>
RESOLVED |