Message ID | 73af1f724be496a366d2edd680124c1fdbd8c32e.1688741159.git.fweimer@redhat.com |
---|---|
State | New |
Headers | show
Return-Path: <libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=CoHfqgik; dkim-atps=neutral Received: from server2.sourceware.org (ip-8-43-85-97.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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QyMxy0CzYz20WT for <incoming@patchwork.ozlabs.org>; Sat, 8 Jul 2023 04:54:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F297E386EAF9 for <incoming@patchwork.ozlabs.org>; Fri, 7 Jul 2023 18:54:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F297E386EAF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688756052; bh=2YTwT7aoD/L4eBWuPGUAmqSqS4+u/hlzx8qPiHbloEE=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=CoHfqgikj5iH5F1YQkfqdHr3Zx1EDCZsUDVQf9Cq19P67Q8L3q6E4a+6JvrhOZfl+ PuPE9PcHxkOwN5zionpqnC7LcUnwoXe5KEc77UXXmFfe43+mVRnj8dA1pm+RMNDfxM tCTRfETs23LhCTkiT32ImTrtvE254rkAbSQM8xFg= 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 ESMTPS id 4F770386FAAA for <libc-alpha@sourceware.org>; Fri, 7 Jul 2023 18:49:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F770386FAAA Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-X3lLLY7IMpSGfRyr1k1o2g-1; Fri, 07 Jul 2023 14:49:55 -0400 X-MC-Unique: X3lLLY7IMpSGfRyr1k1o2g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C493F3844FAA for <libc-alpha@sourceware.org>; Fri, 7 Jul 2023 18:49:54 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C062492C13 for <libc-alpha@sourceware.org>; Fri, 7 Jul 2023 18:49:53 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v2 29/32] elf: Use _dl_find_object instead of _dl_find_dso_for_object in dlopen In-Reply-To: <cover.1688741159.git.fweimer@redhat.com> Message-ID: <73af1f724be496a366d2edd680124c1fdbd8c32e.1688741159.git.fweimer@redhat.com> References: <cover.1688741159.git.fweimer@redhat.com> X-From-Line: 73af1f724be496a366d2edd680124c1fdbd8c32e Mon Sep 17 00:00:00 2001 Date: Fri, 07 Jul 2023 20:49:52 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Florian Weimer <fweimer@redhat.com> Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org> |
Series |
RELRO link maps
|
expand
|
diff --git a/elf/dl-open.c b/elf/dl-open.c index 9f9407341e..9bd48826f9 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -894,8 +894,10 @@ no more namespaces available for dlmopen()")); if (nsid == __LM_ID_CALLER || strchr (file, '$') != NULL || strchr (file, '/') == NULL) { - args.caller_map = _dl_find_dso_for_object ((ElfW(Addr)) caller_dlopen); - if (args.caller_map == NULL) + struct dl_find_object dlfo; + if (_dl_find_object ((void *) caller_dlopen, &dlfo) == 0) + args.caller_map = l_private (dlfo.dlfo_link_map); + else /* By default we assume this is the main application. */ args.caller_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded; if (args.nsid == __LM_ID_CALLER)