From patchwork Thu Oct 31 16:09:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 2004735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V/vVW+uC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XfTTs4rfKz1xwc for ; Fri, 1 Nov 2024 03:09:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C81303857719 for ; Thu, 31 Oct 2024 16:09:51 +0000 (GMT) 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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id A6E1B3857BBF for ; Thu, 31 Oct 2024 16:09:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6E1B3857BBF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A6E1B3857BBF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730390966; cv=none; b=fTjk1ABDkDC79RVaw/LO5LjEcpTzaFUYNOaOZLGvFuYt5nsCLOf3HTorPLqKmF6uTdF2g3nRGI86QN5/0Bb/1i1kIjDV5PrIDKk+G+06zgguNm617yhztSFphX4FPcWFjaapLkjZBzS58gFmPHUSZ1YAvG5BfALAtnA24Rk+4EA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730390966; c=relaxed/simple; bh=DpaAFS1CccJfbXBnLpaGKjGUJc4hSFdX01WMzMDjDMk=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=LIqVstslBxG5yH+nqFWecZ/5zz/CZWnFhC7n+fzuVJ2eWUqxIOY55bjK1DnPAgWpjMuHqL2Pg3Nw7ijoAoqt71t9VdL3NZwSLOOFS7+Dss/GLYKUJYFmabBUxzdRUyMp1CxVGZv5l8y1GerM9q6hkOoeBbPAm3tL5E6ErVBa8TM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730390959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=+yS0BFG/Bdz4FiysoDkTcV94OgNSZ81obMl0lrCvMLc=; b=V/vVW+uC+Ammlu4wgE6j3fm33iRsDKRkaOv2eIWCtT3J1WEFsUbdEtg6GuqdacsMfG2Ypp p1yoPc3LFlBOqGwCSfyfIpBzMnyCJ2g+jGE8pXLSWN35uvzw2bmRNxtEy1QOhpugQRDq5f pWlXZUFX7Qmg3Q8oUkK5luYe1E+mwo4= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-Hv9wFhrvNTGDoh7Iu48gCQ-1; Thu, 31 Oct 2024 12:09:16 -0400 X-MC-Unique: Hv9wFhrvNTGDoh7Iu48gCQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F13731954AE0 for ; Thu, 31 Oct 2024 16:09:12 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.225.77]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B8AD81955F45; Thu, 31 Oct 2024 16:09:11 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: DJ Delorie Subject: [PATCH v2 0/4] elf: More careful placement of the main malloc switch Message-ID: X-From-Line: b60c89eb447e15203946a76dcd48d89d9d645bc4 Mon Sep 17 00:00:00 2001 Date: Thu, 31 Oct 2024 17:09:08 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This series is a rebase on top of current development. The second patch is new, it fixes a build failure with the following patch in profiling mode because it reused the consider_profiling identifier that was originally defined as a macro. Tested on i686-linux-gnu and x86_64-linux-gnu. Florian Weimer (4): elf: rtld_multiple_ref is always true elf: Do not define consider_profiling, consider_symbind as macros elf: Introduce _dl_relocate_object_no_relro elf: Switch to main malloc after final ld.so self-relocation elf/Makefile | 9 +++ elf/dl-reloc.c | 32 +++++----- elf/dl-support.c | 3 +- elf/rtld.c | 101 ++++++++++++++----------------- elf/tst-rtld-no-malloc-audit.c | 1 + elf/tst-rtld-no-malloc-preload.c | 1 + elf/tst-rtld-no-malloc.c | 75 +++++++++++++++++++++++ sysdeps/generic/ldsodefs.h | 7 +++ 8 files changed, 155 insertions(+), 74 deletions(-) create mode 100644 elf/tst-rtld-no-malloc-audit.c create mode 100644 elf/tst-rtld-no-malloc-preload.c create mode 100644 elf/tst-rtld-no-malloc.c base-commit: 383e4f53cbd52a0e697a80a3aa7a7ef891ead8b8