From patchwork Fri Dec 6 17:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 847840 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp910629wrt; Fri, 6 Dec 2024 09:40:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXIWn6JvpmSWdVxdJQ/bGmNPjV+mbH+6LUi0YASVWttDBeA53plV0uYRYGN5YoHE0bc5aZGyQ==@linaro.org X-Google-Smtp-Source: AGHT+IFtNCm/132gqHxSUKnfmuTXPxO7fzoOeVyYqYRpb7AhUhs3VUSFgjzyG732N6Qk34GqnEgF X-Received: by 2002:a67:e916:0:b0:4af:d487:45ef with SMTP id ada2fe7eead31-4afd4874811mr2434538137.5.1733506823447; Fri, 06 Dec 2024 09:40:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1733506823; cv=pass; d=google.com; s=arc-20240605; b=Jue36H+fTp/wzlWzBalTj4lci1Xab0SEiE2V6rb/f5qMfrAMP/DKoZANRzXFu+rkAU y8VKeSa/EG4frJTo909j7d75/q+LEXbKOvz4o1BDQ04oJ330pPHGJxty2fpSS8pMeci9 wNRMNNUJoFeI68PjtHN8GYSLklFXLz7h6MnntmzQ8J+KDeb4U2WxhyNhz3VfwFRehkLD N1F4olv+Dlll4RRrcXoepEdKC4a/jWOuB2To9syS4AsTXOkn6bAcosaGwTIVEMya0Mho WNAQoV94/WkI6YtoC5icOw5p58ZHXqTxhe3GXIpoD2r413OwHewAWSb2EsZSUNR1EXmp yKwQ== 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:dkim-filter:arc-filter:dmarc-filter :delivered-to:dkim-filter; bh=DQ1VYmtKopRl3kxpKVrrjfD0u5jpRgSDan+eK48KvDY=; fh=39H2oohB6ZYGhyKHcKf9chiYMCdt+XzUdxuRAxp69qM=; b=L0YgGd3SoL9zfbILuvDaMs+NIpVpwC//U9M6p1f9pHM8Cz0rB6ckBBFZ51PbTPUUd5 qN4+a91IC80KoFx2QRKk4qoijb6txzZlVSi8Zq4Su9Xwf94hFA8dqAB6YK3heXUqNzxZ vFmnCwbqaSYtbB20FFuCI4t/Zjb80ysAZDzn1Kg70nq4rmx2gQYFlDptKgi6IcaWrffA Vp5wIIy3ysCoOO7kdd8ImM4I77c9T5+pjmOBpT0ZVm27a3+NiGjiZT15N9Q/KlLVkZAA TuUYKOriAWwxf0BUGLMekkQfQLvb510/CrRXquASoDFTJcDbGfFh4HwkJMSpEfSM4WFR sNXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kRIZ6N2o; 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 ada2fe7eead31-4afbc507001si1321196137.76.2024.12.06.09.40.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 09:40:23 -0800 (PST) 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=kRIZ6N2o; 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 EE4A43858408 for ; Fri, 6 Dec 2024 17:40:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE4A43858408 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=kRIZ6N2o X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 8D1513858406 for ; Fri, 6 Dec 2024 17:39:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D1513858406 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 8D1513858406 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733506747; cv=none; b=bejqoNINHdpJZHVvZsEI0wZTErQPSTEydmMtoN3+dIlayzi7RNP5n4FozZBD+l5LTiB9breUX7428SWesWd8HB9ZdJr4bOmCya1WX+Oq18mtuJDuA1XxvrhY9kYlY2hI0pCR/yvsvLKcik7/g6Qi5b3bgbKZVesbw2Ax4PsSRr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733506747; c=relaxed/simple; bh=AGImmDbiUGTsRLXgLYMFa4a+wzUvDG0YH4hoSJ0Xinc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HqC7rexAviTy0/e5mpP5fy7z+fhN8vdmCA68C0D+xs473hIJr5TNN/VNBWkR5BMESfc0XCRJFt6vdEAvoTeXwg4GezZCzjvWsiP7HJ29YFHPbp9RYkCVQHRHl2nLqTN4Vvbn0pA4fFH9VOV4CK5kyPWKRcj+urZSNEaFvWxvIME= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D1513858406 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-725ad59ad72so1545534b3a.2 for ; Fri, 06 Dec 2024 09:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733506746; x=1734111546; 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=DQ1VYmtKopRl3kxpKVrrjfD0u5jpRgSDan+eK48KvDY=; b=kRIZ6N2o1xAxrY3UUko5R9B5WvUK3iYKIVFlLHrWP+qz7ZJHYqQaWYIn09zYAT6vWf JRt2FOJQro7NFmLQwqmQ440YtoSaIrwInU3iKhYzavDrHssw3izlWg6NZ2Wc7kZBEOuG 3lNqC5BfaXCW1Emn3SSf2MyKD0Gs+QtZsrpTnIuUeZzQb5QhOA9ebtz31H/sfscUjnYi 5jcHJmwQHpfTNcraeX3Wjde2e4+GescRBzkCYGtPzjyNctur9VIy+VCkaMU2SRd2RNvR 7jf3CCOIVsNuHABxdJANPXQIxrq+qzYmL/2l4wvEtsbjalNhZ3naDA5+3c2DKsIpZ5MD Q3VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733506746; x=1734111546; 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=DQ1VYmtKopRl3kxpKVrrjfD0u5jpRgSDan+eK48KvDY=; b=EmFoNCCSYlvTFEQ2FX2lQ/Ci7tyGvhesULqjepvBlk4fcC3ytpCRAmaf8OPmxo115H f3uhHLlMxkYstGCfaYpLmhlZzfRGlOC03wJohl1JCC2Zg0KGMrWzWwE9U7ReKNyClSsX 94rO27cjLm1QUVt+p4dBHPhhu0QpLpIlpQdvHjbsyv/NBC0peZ/PJH7jZszAwz33YmBH 9+ug20QIYdYPUZuT7YiwChW/QO6TQxViwrPCv0YSDQaMcCsBInt5M2bkO2kaInTf6dMr nd1LFEJ2/7rjfcXJv+dRQFTeZJjTYmHD2BYiP6AYU6M8jYIz93dJln4Q9pKOfeYzuSx/ u+IQ== X-Gm-Message-State: AOJu0Yy8L2FU0ulc+Mu3DijisPkAuhkRD5WEkkL4g4nWiXH/zJCdm5zQ PKl0BhwNuuuoYyBlk8QJcj6Hkvx5SWIWpyuOdaaUMYegOKELQBV5dAl918NrcTRbc1kaJpDXiIF R X-Gm-Gg: ASbGncvhMUg/jLcTMYG1v4oITft4a6zTc7DrfBAf2krk4hLV/FoEDSm3KwDgVgM+UBw B4p/Z8MW1avZpdC+m4bPliOtV9PWc8XRM9aJcwDX8VTj4/GCDpU0kOVJMiMl/L3UGa1/7hyQ27w AKSgqLpSO9grCiqsJRcok+2szFRXXBswbBa8u6ri+6hEZ+6eXwXtf0seBQvKmrDn19OqkWbeqdj 29q44EgWZhHcbcFMjGqKgqyeDcJFuAMk+xpDYwC1yQ1GxA/UFEpa+i2uppayA== X-Received: by 2002:a17:902:d50c:b0:215:3205:589a with SMTP id d9443c01a7336-21614dd3cd7mr45397975ad.53.1733506746333; Fri, 06 Dec 2024 09:39:06 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:2d1:1460:dd43:b597:c3fc]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215f8f29635sm31409495ad.241.2024.12.06.09.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 09:39:05 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Jeff Xu , Florian Weimer , Mike Hommey , "H . J . Lu" Subject: [PATCH v4 5/9] elf: Use RTLD_NODELETE for dependencies Date: Fri, 6 Dec 2024 14:37:53 -0300 Message-ID: <20241206173850.3766841-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241206173850.3766841-1-adhemerval.zanella@linaro.org> References: <20241206173850.3766841-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 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 ba3c266e6a..f283a87144 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -604,7 +604,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)