From 1b0ea8c5d886fedabd611a569b5ec58a6f5153e6 Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Sat, 18 Feb 2023 21:52:15 +0000 Subject: elf: Restore ldconfig libc6 implicit soname logic [BZ #30125] While cleaning up old libc version support, the deprecated libc4 code was accidentally kept in `implicit_soname`, instead of the libc6 code. This causes additional symlinks to be created by `ldconfig` for libraries without a soname, e.g. a library `libsomething.123.456.789` without a soname will create a `libsomething.123` -> `libsomething.123.456.789` symlink. As the libc6 version of the `implicit_soname` code is a trivial `xstrdup`, just inline it and remove `implicit_soname` altogether. Some further simplification looks possible (e.g. the call to `create_links` looks like a no-op if `soname == NULL`, other than the verbose printfs), but logic is kept as-is for now. Fixes: BZ #30125 Fixes: 8ee878592c4a ("Assume only FLAG_ELF_LIBC6 suport") Signed-off-by: Joan Bruguera Reviewed-by: Adhemerval Zanella --- elf/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'elf/Makefile') diff --git a/elf/Makefile b/elf/Makefile index 2fc6391..0d19964 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -627,6 +627,7 @@ tests-special += \ $(objpfx)noload-mem.out \ $(objpfx)tst-ldconfig-X.out \ $(objpfx)tst-ldconfig-p.out \ + $(objpfx)tst-ldconfig-soname.out \ $(objpfx)tst-leaks1-mem.out \ $(objpfx)tst-rtld-help.out \ # tests-special @@ -859,6 +860,8 @@ modules-names += \ tst-initorderb2 \ tst-latepthreadmod \ tst-ldconfig-ld-mod \ + tst-ldconfig-soname-lib-with-soname \ + tst-ldconfig-soname-lib-without-soname \ tst-main1mod \ tst-nodelete2mod \ tst-nodelete-dlclose-dso \ @@ -2402,6 +2405,17 @@ $(objpfx)tst-ldconfig-p.out : tst-ldconfig-p.sh $(objpfx)ldconfig '$(run-program-env)' > $@; \ $(evaluate-test) +LDFLAGS-tst-ldconfig-soname-lib-with-soname.so = \ + -Wl,-soname,libtst-ldconfig-soname-lib-with-soname.so.1 + +$(objpfx)tst-ldconfig-soname.out : tst-ldconfig-soname.sh \ + $(objpfx)ldconfig \ + $(objpfx)tst-ldconfig-soname-lib-with-soname.so \ + $(objpfx)tst-ldconfig-soname-lib-without-soname.so + $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \ + '$(run-program-env)' > $@; \ + $(evaluate-test) + # Test static linking of all the libraries we can possibly link # together. Note that in some configurations this may be less than the # complete list of libraries we build but we try to maxmimize this list. -- cgit v1.1