From patchwork Thu Feb 3 18:57:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 50753 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 A94D23858412 for ; Thu, 3 Feb 2022 18:57:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A94D23858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643914678; bh=WpNFCTWYIP3bSC0r4gLPugOortyy6E08BHluhgfL1no=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=tonS+snT18iRi0x8fVP9Bkw8NXZbWWZ+X8JF4aR93ioDlkv/JrVEkicxJRP/j2Jqc ImMnY+DD95bXzLKiYlniKFCph0732zC7Rxw84OaGuySUsDSkTjsJ+R5ungIqgrNGMg oiYwiGV9653ovgl9v8dmCSGkaffAMkXgPh+qoEns= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id AC83D3858D35 for ; Thu, 3 Feb 2022 18:57:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC83D3858D35 Received: by mail-oi1-x229.google.com with SMTP id s185so5556052oie.3 for ; Thu, 03 Feb 2022 10:57:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WpNFCTWYIP3bSC0r4gLPugOortyy6E08BHluhgfL1no=; b=aSVyegJavb8omtOdbvQxJkq8l2Gz5DnLf5getHlZOsH6qu5NrywklRm/GHdtHyvfVX 6askQYUJExS8yUJaGv9FzpdblUDM4eAEkjc3b5DDk/qmQHyyFuudH+HnZqpLmtVcLTD6 1H6opHOzT9QQK9hT6mF5QpqNznXz2PhRv5jUuOgQB8FCYDnmvNVLi883hO0cb1omlHjn TRqWaL67em6mvF06Tuf6NyRA++cHfoiivz4w2SYOLMjEw5iiSBWD9ZsTONVoNb5h9dOm T9kEZOztefA+ZHsV5GdTb7b+To7SXv+EkFoXdEmltR/rLZ1jL+VTM1CkIgZQh6JBPhxZ pKJw== X-Gm-Message-State: AOAM532mJX3xWb5NxFSKT3qfMtaokq67eryOG74VtO6ErMdYs8MJKdJh 7iPd4vxhEBtTX2ySjSbRRSIEJ9JpPJFuIw== X-Google-Smtp-Source: ABdhPJzvNvWXOgoJ/U4p1uRPZgJySerB049xMsu5FKwyAl8BWml4YeuRPl+wU6n0H6kAqsX6cswm8w== X-Received: by 2002:a05:6808:17a7:: with SMTP id bg39mr8565172oib.184.1643914656966; Thu, 03 Feb 2022 10:57:36 -0800 (PST) Received: from birita.. ([2804:431:c7ca:709a:22aa:9542:591f:6eb9]) by smtp.gmail.com with ESMTPSA id c26sm11551785otn.34.2022.02.03.10.57.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 10:57:35 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 0/3] Remove prelink support Date: Thu, 3 Feb 2022 15:57:29 -0300 Message-Id: <20220203185732.1842679-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Cc: Richard Purdie Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" As discussed recently on maillist [1], prelink is deprecated in practice: * There is no active development neither maintainace. * It misses supports for some architectures, even for architecture wildly deployed such as aarch64 [2]. * It does not work with recent security hardening such as PIE. * Nor it will work on future ABI additions such as DT_RELR. * Even when PIE is not enabled its coverity if flacky, with some binaries showing corrupted state [3]. * Recent glibc changes to support different tools (such as lld) showed inherent issue with current prelink support. The first patch removes both prelink support by the loader and the LD_TRACE_PRELINKING. The remove of mtrace TRACE_PRELINKING usage is on its own patch because it changes LD_TRACE_LOADED_OBJECTS semantic to support dumping the executable loading address and fixes mtrace for non PIE similar to BZ#22716. Finally the third part removed LD_USE_LOAD_BIAS, which is used solely for try support prelink with PIE. [1] https://sourceware.org/pipermail/libc-alpha/2022-January/135520.html [2] https://sourceware.org/pipermail/libc-alpha/2022-January/135522.html [3] https://embed.endfa.net/yocto-cross-prelink-1/ Adhemerval Zanella (3): elf: Remove prelink support malloc: Remove LD_TRACE_PRELINKING usage from mtrace elf: Remove LD_USE_LOAD_BIAS NEWS | 16 +- elf/Makefile | 16 -- elf/dl-conflict.c | 77 ------- elf/dl-deps.c | 66 ------ elf/dl-error-skeleton.c | 4 +- elf/dl-load.c | 3 +- elf/dl-lookup.c | 161 -------------- elf/dl-main.h | 3 + elf/dl-map-segments.h | 3 +- elf/dl-support.c | 1 - elf/do-rel.h | 3 - elf/rtld.c | 283 ++++++------------------- elf/tst-prelink-cmp.c | 49 ----- elf/tst-prelink.c | 29 --- include/link.h | 4 - malloc/mtrace.pl | 55 ++--- sysdeps/alpha/dl-machine.h | 15 -- sysdeps/arm/dl-machine.h | 4 - sysdeps/generic/ldsodefs.h | 16 -- sysdeps/generic/unsecvars.h | 1 - sysdeps/i386/dl-machine.h | 16 +- sysdeps/or1k/dl-machine.h | 4 - sysdeps/powerpc/powerpc32/dl-machine.h | 31 +-- sysdeps/powerpc/powerpc64/dl-machine.h | 37 ---- sysdeps/s390/s390-32/dl-machine.h | 22 +- sysdeps/s390/s390-64/dl-machine.h | 22 +- sysdeps/sh/dl-machine.h | 2 +- sysdeps/sparc/sparc32/dl-machine.h | 52 +---- sysdeps/sparc/sparc64/dl-machine.h | 72 +------ sysdeps/x86_64/dl-machine.h | 48 ++--- 30 files changed, 173 insertions(+), 942 deletions(-) delete mode 100644 elf/dl-conflict.c delete mode 100644 elf/tst-prelink-cmp.c delete mode 100644 elf/tst-prelink.c