From patchwork Mon Sep 30 20:08:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 831579 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp2121527wrw; Mon, 30 Sep 2024 13:12:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWj0j2odZ+Nswnp5UFQByKb6qCTZALlbkDoENMiJAlwpMK6mgNCdbDbsdooWyahG4QCnyio8A==@linaro.org X-Google-Smtp-Source: AGHT+IFZTM4v8xuk4oEZ4AwxDlraSF17+D6k6z+oL5j8Sokxwc05mseF7YWr3AMN+p+8k5viTKuE X-Received: by 2002:ac8:5956:0:b0:458:1d6c:e35d with SMTP id d75a77b69052e-45c9f2a3915mr213736671cf.48.1727727143689; Mon, 30 Sep 2024 13:12:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727727143; cv=pass; d=google.com; s=arc-20240605; b=kPenm9LvRhFc6KryALwrZT/LGCMFyUpJqLQfDN31ZgL993jaNT5RnfqJHSS548lwMy xj/cjPh5DI/31o8BWg/Dw3mOd+7gERclbtPERhAS+nGsnj724b5hiAnyieWVZ6xD+GEH v35jly2ahB65uLrqU82L8NJfDLTxf/dzQvHQI1U1jFs//Ok5471GDB8R1CPGrRvHHTPv xgKbknd15WSLw/w44JxrTf6kfLHs7cRsPt4sJhtHQkYKNC0Uk53xpJ9gM9XGlHp50ss2 sexfgzosT14zW4E23F2uCfUVdogNJfZ4ExKnoIRN1mEaOFyBHkrcs+iaEboQLLdjP0lv SPIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=8vqO0JhS9U4c3iOKBOvmros2ivIzywkbp+VAwUy++XY=; fh=3tUIaab7WH3k5DYf15UFmY7vUQNGmrLDHVJFJrkNDfY=; b=C4+ql8gJ6BGvY+T6Tj+dhewLViMChGhQ0lnUzSWj1Oa7RxNToKgLxnN5G8o/CBtZTo Og/cj/3naJCIyCRWI6ZtY1sOD8xT2qySxiScgCvmFginLFRRD4H7nRD1SU/a69usA+ay MlHkzMBXnCh+cMXwc3CBH68UetYOtu83mgJkzQASIvjkb9TBMMuXZgx4jJHKGJakQ7+j zVL7r+NkG5NSm//9PbRomhcv8YXWersleeeE8wPkcduSfBgxLkwGVoa07FzN4b1p7PmW GjyPWT37hVXGcQtTpvi5UbaYN6y0Lyhm/sRFpbnNgv41qx0v7DFy4JQ0bffx+Drl2R76 mzzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yr52dYsC; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d75a77b69052e-45c9f28f852si88578561cf.71.2024.09.30.13.12.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:12:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yr52dYsC; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 483EF38449D9 for ; Mon, 30 Sep 2024 20:12:23 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 287C53846461 for ; Mon, 30 Sep 2024 20:08:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 287C53846461 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 287C53846461 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::12f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727726952; cv=none; b=cuDscCW1hmc/WVXePQAO8X1RKt3VThRjgnoeBnjXxcrXoFqGQyTiCpwHXWbP1tSxHJrhCIQtg0Zw0/KdpvMw3OzFGTXVUA4O5UI5S7vX0rOUGfHSbtpFHEuHbfaDIMHH5Lp9Ugq3U3mMstKR1aq/vscVTQiAYsj/VteG5tYk/8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727726952; c=relaxed/simple; bh=srJsH0o/joYyhIKV8nbjp1/z8n7FiNByCO5SZrPrSw0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=p1P4M4IKUhiQh79y4NW1Cr1qpo78OuxNaUd+iA6QLUknSFfG1pWRjz36MQxNIF2vbv/7mVV0l4rpPwoQaXy/WI6o+tmPp6G0lhYmP6emSHUzuafTiOTro9MEFPy8DXBqReRvj6ifUvhWjlVeDcIw0VUr5sNLtlPJj+hDEnNWx1I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3a3525ba6aaso5697715ab.2 for ; Mon, 30 Sep 2024 13:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727726934; x=1728331734; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8vqO0JhS9U4c3iOKBOvmros2ivIzywkbp+VAwUy++XY=; b=Yr52dYsCD4WRdbBaXr3SwN8gtoMt3Z9jqpopXlEWPl2e3PnxSFu3v1ZM/12da3weFl Jc44d6WavJELPSXqRyhPFYjiua9i8WsN0aQIuyLlSbt9l/xQwA0H6tLkmP7aShDQwPXX hC5q236pfBc4Z7qT8Xtq2BXIcW4WpM8H9pftmVKEb+pr1lvlvLNs1oCtsiBkn22NIZZN ue6w+GCjYzzkYf4V4aCmZS9erEO/4BZjywh6z+PSL3HwcRJSxmtqOZ00WInQT+Rd6AI+ 6nbhlgKRssVmiHRR/4TXOpCht8ZtlTNymsSQd+YN5iUHEJ2sYSLI8m1Xjt0XCizBw/BC ho+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727726934; x=1728331734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8vqO0JhS9U4c3iOKBOvmros2ivIzywkbp+VAwUy++XY=; b=dhDpE92HCYVCRCUGrTtXsb5aLSCpWhI8uLFOft2dFhGhpDOXopsMjyBnh6BFuroBS4 ieb+4H1pNs78YTlTV9JI4Eg0KzXqMJPROV3f+NkSLZuFsgXe9v/oTVlOkhZ495t37sqb qK0vtnjSi4trxV6tdSqKjZ9tDm1fZ7paNs0T93wy6G2KQr0B6ldfEGysbGuuYl58jE9W znjmbRLTSKXIH5CbDLXbQ3D9TkUFZt4PIvSBu1bMvUflvzJ16W4XzsCecHPOpLsStSag ED22UOrNUSTYt1oQqdFfSbQy5ifBb+QyakJ6lSWQGzXTdLX9s0e0ilKNnvSdN986NEs5 SITA== X-Gm-Message-State: AOJu0Yw49rhpBjdO2wawasXck3VrvOxatA2P8aLLhopuf2Nyf6ltXf2e GtVTzy7F4iCeW/AHakJG2ZXlLRn0SR0yG4ueh936dkeCtnqgHNxwvElcjpqxY2BCfAHXs01zbfd TOKg= X-Received: by 2002:a05:6e02:2188:b0:3a3:35f0:4c19 with SMTP id e9e14a558f8ab-3a3451b454cmr98475155ab.21.1727726934102; Mon, 30 Sep 2024 13:08:54 -0700 (PDT) Received: from ubuntu-vm.. (201-92-183-102.dsl.telesp.net.br. [201.92.183.102]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2c4845sm6869565a12.43.2024.09.30.13.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:08:53 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Stephen Roettger , Jeff Xu , Florian Weimer , Mike Hommey , Adhemerval Zanella Subject: [PATCH v3 5/9] elf: Use RTLD_NODELETE for dependencies Date: Mon, 30 Sep 2024 17:08:27 -0300 Message-Id: <20240930200831.1669010-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240930200831.1669010-1-adhemerval.zanella@linaro.org> References: <20240930200831.1669010-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patch=linaro.org@sourceware.org So dlopen dependencies for objects opened with RTLD_NODELETE are also marked with RTLD_NODELETE. Checked on x86_64-linux-gnu. --- elf/dl-open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elf/dl-open.c b/elf/dl-open.c index 8b4704c09d..f251781dc4 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -600,7 +600,8 @@ dl_open_worker_begin (void *a) /* Load that object's dependencies. */ _dl_map_object_deps (new, NULL, 0, 0, - mode & (__RTLD_DLOPEN | RTLD_DEEPBIND | __RTLD_AUDIT)); + mode & (__RTLD_DLOPEN | RTLD_DEEPBIND | __RTLD_AUDIT + | RTLD_NODELETE)); /* So far, so good. Now check the versions. */ for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)