From patchwork Thu Oct 1 16:31:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 40594 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A8F4398B80A; Thu, 1 Oct 2020 16:32:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A8F4398B80A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601569922; bh=AvONDWoNN+rHoizoum+3YnUjSm61bsYT/YMmrDYDIGw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=yQ2spQcepvtY3uVw9iXFmjlsS+81t2SybfMEmjUoBENkPhYjvtf6Q7tCb0eUYc1WG Q6gmwmvrR1RHEU88pZoxHgVRivPoOtq8JmXVfKWBB23hnX3Xil3n4zMOdiACnYkamh aWMk4eq7LZ8g3ycP2clG1NaUIOlYlev250tfNLik= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id F03A93857C41 for ; Thu, 1 Oct 2020 16:31:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F03A93857C41 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-490-q4e3RirUPBSuMQ4KVpDxSQ-1; Thu, 01 Oct 2020 12:31:53 -0400 X-MC-Unique: q4e3RirUPBSuMQ4KVpDxSQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C40461006716 for ; Thu, 1 Oct 2020 16:31:27 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-114-84.ams2.redhat.com [10.36.114.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1820D73677 for ; Thu, 1 Oct 2020 16:31:26 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 00/28] glibc-hwcaps support Message-Id: Date: Thu, 01 Oct 2020 18:31:25 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This is a rebase of the previous patch series. I adjusted it for the --argv0 ld.so change, added POWER10 support, and switched to the real subdirectory names in the x86-64 psABI. I think the patches up to “elf: Enhance ld.so --help to print HWCAP subdirectories” are useful on their own because they add diagnostics for existing functionality. The ld.so.cache extension mechanism and the string table are also fairly independent parts. What's still missing? * documentation (including NEWS file updates) * negative caching of missing glibc-hwcaps subdirectories (in bulk) * tests I would like to work on these aspects in parallel to the patch reviews. (Lack of negative caching makes it obvious what's going on with strace, so it's perhaps even helpful that it's currently missing.) Support in GCC has landed earlier this week: I filed a separate LLVM bug, but do not plan to work on it for now: Thanks, Florian Florian Weimer (28): elf: Do not search HWCAP subdirectories in statically linked binaries elf: Implement __rtld_malloc_is_full elf: Implement _dl_write elf: Extract command-line/environment variables state from rtld.c elf: Move ld.so error/help output to _dl_usage elf: Record whether paths come from LD_LIBRARY_PATH or --library-path elf: Implement ld.so --help elf: Implement ld.so --version scripts/update-copyrights: Update csu/version.c, elf/dl-usage.c elf: Use the term "program interpreter" in the ld.so help message elf: Print the full name of the dynamic loader in the ld.so help message elf: Make __rtld_env_path_list and __rtld_search_dirs global variables elf: Add library search path information to ld.so --help elf: Enhance ld.so --help to print HWCAP subdirectories elf: Do not pass GLRO(dl_platform), GLRO(dl_platformlen) to _dl_important_hwcaps elf: Add glibc-hwcaps support for LD_LIBRARY_PATH x86_64: Add glibc-hwcaps support powerpc64le: Add glibc-hwcaps support s390x: Add Add glibc-hwcaps support aarch64: Add glibc-hwcaps support elf: Add endianness markup to ld.so.cache elf: Add extension mechanism to ld.so.cache elf: Unify old and new format cache handling code in ld.so elf: Implement a string table for ldconfig, with tail merging elf: Implement tail merging of strings in ldconfig elf: In ldconfig, extract the new_sub_entry function from search_dir elf: Process glibc-hwcaps subdirectories in ldconfig elf: Add glibc-hwcaps subdirectory support to ld.so cache processing NEWS | 4 + elf/Makefile | 22 +- elf/cache.c | 400 +++++++++++++-- elf/dl-cache.c | 483 ++++++++++++------ elf/dl-hwcaps-subdirs.c | 29 ++ elf/dl-hwcaps.c | 225 +++++++- elf/dl-hwcaps.h | 102 ++++ elf/dl-hwcaps_split.c | 77 +++ elf/dl-load.c | 75 +-- elf/dl-main.h | 120 +++++ elf/dl-minimal.c | 8 + elf/dl-support.c | 5 +- elf/dl-usage.c | 268 ++++++++++ elf/dl-write.c | 56 ++ elf/ldconfig.c | 187 +++++-- elf/rtld.c | 251 ++++----- elf/stringtable.c | 201 ++++++++ elf/stringtable.h | 61 +++ elf/stringtable_free.c | 32 ++ elf/tst-dl-hwcaps_split.c | 139 +++++ elf/tst-stringtable.c | 140 +++++ include/link.h | 4 + include/rtld-malloc.h | 4 + scripts/update-copyrights | 6 + sysdeps/aarch64/dl-hwcaps-subdirs.c | 31 ++ sysdeps/generic/dl-cache.h | 232 ++++++++- sysdeps/generic/ldconfig.h | 18 +- sysdeps/generic/ldsodefs.h | 34 +- .../powerpc/powerpc64/le/dl-hwcaps-subdirs.c | 34 ++ sysdeps/s390/s390-64/dl-hwcaps-subdirs.c | 54 ++ sysdeps/unix/sysv/linux/dl-write.c | 30 ++ sysdeps/x86_64/dl-hwcaps-subdirs.c | 69 +++ 32 files changed, 2977 insertions(+), 424 deletions(-) create mode 100644 elf/dl-hwcaps-subdirs.c create mode 100644 elf/dl-hwcaps_split.c create mode 100644 elf/dl-main.h create mode 100644 elf/dl-usage.c create mode 100644 elf/dl-write.c create mode 100644 elf/stringtable.c create mode 100644 elf/stringtable.h create mode 100644 elf/stringtable_free.c create mode 100644 elf/tst-dl-hwcaps_split.c create mode 100644 elf/tst-stringtable.c create mode 100644 sysdeps/aarch64/dl-hwcaps-subdirs.c create mode 100644 sysdeps/powerpc/powerpc64/le/dl-hwcaps-subdirs.c create mode 100644 sysdeps/s390/s390-64/dl-hwcaps-subdirs.c create mode 100644 sysdeps/unix/sysv/linux/dl-write.c create mode 100644 sysdeps/x86_64/dl-hwcaps-subdirs.c